From fc3d2bb4dc01da73bb9fe068f3bc5e741083430d Mon Sep 17 00:00:00 2001 From: hannah98 Date: Thu, 6 Jan 2022 14:14:41 +0000 Subject: [PATCH] rename TAG_SEPARATORS to TAG_SEPARATOR_PATTERN --- archivebox/config.py | 2 +- archivebox/config_stubs.py | 2 +- archivebox/index/sql.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/archivebox/config.py b/archivebox/config.py index 6eba098f..89d009ce 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -79,7 +79,7 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = { 'URL_BLACKLIST': {'type': str, 'default': r'\.(css|js|otf|ttf|woff|woff2|gstatic\.com|googleapis\.com/css)(\?.*)?$'}, # to avoid downloading code assets as their own pages 'URL_WHITELIST': {'type': str, 'default': None}, 'ENFORCE_ATOMIC_WRITES': {'type': bool, 'default': True}, - 'TAG_SEPARATORS': {'type': str, 'default': '[,]'}, + 'TAG_SEPARATOR_PATTERN': {'type': str, 'default': '[,]'}, }, 'SERVER_CONFIG': { diff --git a/archivebox/config_stubs.py b/archivebox/config_stubs.py index 432b86d8..ead541a5 100644 --- a/archivebox/config_stubs.py +++ b/archivebox/config_stubs.py @@ -98,7 +98,7 @@ class ConfigDict(BaseConfig, total=False): WGET_ARGS: List[str] CURL_ARGS: List[str] GIT_ARGS: List[str] - TAG_SEPARATORS: str + TAG_SEPARATOR_PATTERN: str ConfigDefaultValueGetter = Callable[[ConfigDict], ConfigValue] diff --git a/archivebox/index/sql.py b/archivebox/index/sql.py index 66402af7..420b9de6 100644 --- a/archivebox/index/sql.py +++ b/archivebox/index/sql.py @@ -12,7 +12,7 @@ from .schema import Link from ..util import enforce_types, parse_date from ..config import ( OUTPUT_DIR, - TAG_SEPARATORS, + TAG_SEPARATOR_PATTERN, ) @@ -40,7 +40,7 @@ def write_link_to_sql_index(link: Link): info = {k: v for k, v in link._asdict().items() if k in Snapshot.keys} tag_list = list(dict.fromkeys( - tag.strip() for tag in re.split(TAG_SEPARATORS, link.tags or '') + tag.strip() for tag in re.split(TAG_SEPARATOR_PATTERN, link.tags or '') )) info.pop('tags') @@ -112,7 +112,7 @@ def write_sql_link_details(link: Link, out_dir: Path=OUTPUT_DIR) -> None: snap.title = link.title tag_list = list(dict.fromkeys( - tag.strip() for tag in re.split(TAG_SEPARATORS, link.tags or '') + tag.strip() for tag in re.split(TAG_SEPARATOR_PATTERN, link.tags or '') )) snap.save()