add missing return types

This commit is contained in:
2023-01-21 09:42:31 +01:00
parent 3e3f51d152
commit d17c0a56f9
2 changed files with 5 additions and 5 deletions

View File

@@ -36,12 +36,12 @@ class Line:
prefix_chars = prefix_bytes.decode("utf8", errors="ignore") prefix_chars = prefix_bytes.decode("utf8", errors="ignore")
return len(prefix_chars) return len(prefix_chars)
def line_prepared_for_display(self): def line_prepared_for_display(self) -> str:
line = self._line_tabs_replaced() line = self._line_tabs_replaced()
line = self._replace_control_chars_with_pictures(line) line = self._replace_control_chars_with_pictures(line)
return line return line
def _replace_control_chars_with_pictures(self, line: str): def _replace_control_chars_with_pictures(self, line: str) -> str:
length = len(line) length = len(line)
for i in range(length): for i in range(length):
c = line[i] c = line[i]
@@ -58,7 +58,7 @@ class Line:
return line; return line;
def _line_tabs_replaced(self): def _line_tabs_replaced(self) -> str:
line = self._line; line = self._line;
i = 0 i = 0
offset = 0 offset = 0

View File

@@ -53,13 +53,13 @@ class LogFileModel:
is_regex=is_regex, is_regex=is_regex,
hit_background_color="ffff00") hit_background_color="ffff00")
def get_tab_name(self): def get_tab_name(self) -> str:
file_name = os.path.basename(self._file) file_name = os.path.basename(self._file)
if len(file_name) > 35: if len(file_name) > 35:
file_name = file_name[:15] + "..." + file_name[-15:] file_name = file_name[:15] + "..." + file_name[-15:]
return file_name return file_name
def read_range(self, start_byte: int, end_byte: int): def read_range(self, start_byte: int, end_byte: int) -> str:
# with self._lock: # with self._lock:
if True: if True:
with open(self._file, 'rb') as f: with open(self._file, 'rb') as f: