From 5da0a0769375ccb55d7d940ed0ce4f859db654f3 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 25 Jan 2026 20:07:06 +0100 Subject: [PATCH] raw regexp --- pandora/app/documentation.py | 4 ++-- pandora/archive/management/commands/migrate_timelines.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora/app/documentation.py b/pandora/app/documentation.py index 89abf100..9f5e285e 100644 --- a/pandora/app/documentation.py +++ b/pandora/app/documentation.py @@ -9,7 +9,7 @@ def get(config_jsonc='config.pandora.jsonc'): data = fd.read().decode('utf-8') config = ox.jsonc.loads(data) docs = {} - for m in re.compile('( \/\*.*?\*\/)\W+"([^\W]+?)":', re.DOTALL).findall(data): + for m in re.compile(r'( \/\*.*?\*\/)\W+"([^\W]+?)":', re.DOTALL).findall(data): docs[m[1]] = m[0].strip() ''' for key in config: @@ -29,7 +29,7 @@ def update(config_jsonc='config.jsonc', base='config.pandora.jsonc'): current_docs = get(config_jsonc) for key in docs: if key in current_docs: - match = '\n' + re.escape(' ' + current_docs[key]) + '\W+"' + re.escape(key) + '":' + match = '\n' + re.escape(' ' + current_docs[key]) + r'\W+"' + re.escape(key) + '":' else: match = '\n "' + re.escape(key) + '":' data = re.sub(match, '\n %s\n "%s":' % (docs[key], key), data) diff --git a/pandora/archive/management/commands/migrate_timelines.py b/pandora/archive/management/commands/migrate_timelines.py index d4ce903d..95126867 100644 --- a/pandora/archive/management/commands/migrate_timelines.py +++ b/pandora/archive/management/commands/migrate_timelines.py @@ -25,9 +25,9 @@ class Command(BaseCommand): print('delete', f) os.unlink(f) else: - n = re.compile('timeline(\d+)p(\d+)').findall(base) + n = re.compile(r'timeline(\d+)p(\d+)').findall(base) if not n: - n = re.compile('timeline(\d+)p').findall(base) + n = re.compile(r'timeline(\d+)p').findall(base) target = 'timelineantialias%sp.jpg' % n[0] print(f, target) target = os.path.join(os.path.dirname(f), target)