Preprend regex string literals with an 'r' making them raw strings

pull/41/head
matthewanderson 2023-10-24 16:28:18 -05:00
parent 335cb3ae75
commit 6cef067a9a
1 changed files with 4 additions and 4 deletions

View File

@ -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]