Skip to content

Commit

Permalink
~
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-chs committed Oct 18, 2023
1 parent 57b1428 commit 57e7033
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions models/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

from datetime import datetime, timedelta
from re import Pattern as RegexPattern
from re import Pattern
from re import compile as re_compile
from time import ctime
from typing import Any
Expand Down Expand Up @@ -226,7 +226,7 @@ def to_markdown(self) -> str:

def sanitized_title(self) -> str:
"""Sanitized title of the conversation, compatible with file names."""
file_anti_pattern: RegexPattern[str] = re_compile(
file_anti_pattern: Pattern[str] = re_compile(
pattern=r'[<>:"/\\|?*\n\r\t\f\v]',
)
return (
Expand Down
10 changes: 5 additions & 5 deletions utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Utility functions for the project."""

from pathlib import Path
from re import sub as re_sub
from re import sub
from zipfile import ZipFile


Expand Down Expand Up @@ -30,10 +30,10 @@ def ensure_closed_code_blocks(string: str) -> str:

def replace_latex_delimiters(string: str) -> str:
"""Replace all the LaTeX bracket delimiters in the string with dollar sign ones."""
string = re_sub(pattern=r"\\\[", repl="$$", string=string)
string = re_sub(pattern=r"\\\]", repl="$$", string=string)
string = re_sub(pattern=r"\\\(", repl="$", string=string)
string = re_sub(pattern=r"\\\)", repl="$", string=string)
string = sub(pattern=r"\\\[", repl="$$", string=string)
string = sub(pattern=r"\\\]", repl="$$", string=string)
string = sub(pattern=r"\\\(", repl="$", string=string)
string = sub(pattern=r"\\\)", repl="$", string=string)

return string

Expand Down

0 comments on commit 57e7033

Please sign in to comment.