From 6cef067a9a28110087a3a95068322e83942ce754 Mon Sep 17 00:00:00 2001 From: matthewanderson Date: Tue, 24 Oct 2023 16:28:18 -0500 Subject: [PATCH] Preprend regex string literals with an 'r' making them raw strings --- autodoist.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autodoist.py b/autodoist.py index 957fa9d..38373ff 100644 --- a/autodoist.py +++ b/autodoist.py @@ -683,8 +683,8 @@ def remove_label(task, label, overview_task_ids, overview_task_labels): def check_header(api, model): header_all_in_level = False unheader_all_in_level = False - regex_a = '(^[*]{2}\s*)(.*)' - regex_b = '(^\-\*\s*)(.*)' + regex_a = r'(^[*]{2}\s*)(.*)' + regex_b = r'(^\-\*\s*)(.*)' try: if isinstance(model, Task): @@ -1366,7 +1366,7 @@ def autodoist_magic(args, api, connection): # If start-date has not passed yet, remove label try: f1 = re.search( - 'start=(\d{2}[-]\d{2}[-]\d{4})', task.content) + r'start=(\d{2}[-]\d{2}[-]\d{4})', task.content) if f1: start_date = f1.groups()[0] start_date = datetime.strptime( @@ -1389,7 +1389,7 @@ def autodoist_magic(args, api, connection): if task.due is not None: try: f2 = re.search( - 'start=due-(\d+)([dw])', task.content) + r'start=due-(\d+)([dw])', task.content) if f2: offset = f2.groups()[0]