fix(re): use raw strings in all regexps
This commit is contained in:
parent
67740f30f3
commit
ed01a9a128
1 changed files with 4 additions and 4 deletions
|
|
@ -894,7 +894,7 @@ if __name__ == "__main__":
|
||||||
uptaskfile = find_tasks(".task", task_dir.parent, config)
|
uptaskfile = find_tasks(".task", task_dir.parent, config)
|
||||||
if uptaskfile:
|
if uptaskfile:
|
||||||
uprelp = pathlib.Path(os.path.relpath(task_dir.parent, cwd))
|
uprelp = pathlib.Path(os.path.relpath(task_dir.parent, cwd))
|
||||||
upreli = re.sub("\.\./*", "⮤", str(uprelp))
|
upreli = re.sub(r"\.\./*", "⮤", str(uprelp))
|
||||||
upjdata = get_data(uptaskfile)
|
upjdata = get_data(uptaskfile)
|
||||||
try:
|
try:
|
||||||
console.print(w.rtext(f"{upreli} {uptaskfile.parent.name}/: ", swatch="parentdir"), end="")
|
console.print(w.rtext(f"{upreli} {uptaskfile.parent.name}/: ", swatch="parentdir"), end="")
|
||||||
|
|
@ -903,8 +903,8 @@ if __name__ == "__main__":
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Relative path to the directory holding the task files.
|
# Relative path to the directory holding the task files.
|
||||||
rela = re.sub("\.\./*", "⮤", str(relp))
|
rela = re.sub(r"\.\./*", "⮤", str(relp))
|
||||||
reli = re.sub("\.", "", rela)
|
reli = re.sub(r"\.", "", rela)
|
||||||
if reli:
|
if reli:
|
||||||
console.rule(w.rtext(f"{reli} {task_dir.name}", swatch="taskdir"), style=config["color.taskdir"])
|
console.rule(w.rtext(f"{reli} {task_dir.name}", swatch="taskdir"), style=config["color.taskdir"])
|
||||||
else:
|
else:
|
||||||
|
|
@ -919,7 +919,7 @@ if __name__ == "__main__":
|
||||||
downtaskfile = find_tasks(".task", pathlib.Path(f), config)
|
downtaskfile = find_tasks(".task", pathlib.Path(f), config)
|
||||||
if downtaskfile and downtaskfile != taskfile:
|
if downtaskfile and downtaskfile != taskfile:
|
||||||
downrelp = pathlib.Path(os.path.relpath(task_dir.parent, cwd))
|
downrelp = pathlib.Path(os.path.relpath(task_dir.parent, cwd))
|
||||||
downreli = re.sub("\.\./*", "⮧ ", str(downrelp))
|
downreli = re.sub(r"\.\./*", "⮧ ", str(downrelp))
|
||||||
downjdata = get_data(downtaskfile)
|
downjdata = get_data(downtaskfile)
|
||||||
console.print(w.rtext(f"{downreli}./{downtaskfile.parent.name}: ", swatch="parentdir"), end="")
|
console.print(w.rtext(f"{downreli}./{downtaskfile.parent.name}: ", swatch="parentdir"), end="")
|
||||||
console.print(w.rtext(f"{len(downjdata)} tasks", swatch="parentdir.tasks"))
|
console.print(w.rtext(f"{len(downjdata)} tasks", swatch="parentdir.tasks"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue