mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
fix type annotation
This commit is contained in:
parent
c8faad0acf
commit
b8f54d79e3
1 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ class CodeSlicer:
|
|||
start: int
|
||||
end: int
|
||||
|
||||
indentation: str
|
||||
indentation: str | None
|
||||
text: list[str]
|
||||
|
||||
_next_line = None
|
||||
|
@ -47,7 +47,7 @@ class CodeSlicer:
|
|||
|
||||
def push_line(self, string: str) -> None:
|
||||
self._next_line = self._next_line or self.start + 1
|
||||
self.text.insert(self._next_line, self.indentation + string + "\n")
|
||||
self.text.insert(self._next_line, self.indentation or "" + string + "\n")
|
||||
self._next_line += 1
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ def get_indentation_of_string(line: str, comment_char: str = "//|#") -> str:
|
|||
return re.sub(rf"{comment_char}.*", "", line).removesuffix("\n")
|
||||
|
||||
|
||||
def find_start_end(file_text: list[str], gen_id: str) -> tuple[int, int, str]:
|
||||
def find_start_end(file_text: list[str], gen_id: str) -> tuple[int, int, str | None]:
|
||||
start = None
|
||||
end = None
|
||||
indentation = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue