Skip to content

Commit

Permalink
add None as return type
Browse files Browse the repository at this point in the history
  • Loading branch information
Lmh-java committed Jan 19, 2025
1 parent 091ea83 commit 5929f09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/software/thunderscope/replay/bookmark_marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(

self.update()

def update(self):
def update(self) -> None:
"""Update bookmark visuals display"""
super().update()
# Re-calculate the position of the visuals
Expand Down
10 changes: 5 additions & 5 deletions src/software/thunderscope/replay/proto_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def is_log_entry_corrupt(log_entry: bytes, version: int) -> bool:
except Exception:
return True

def handle_log_line_for_chunk(self, **kwargs):
def handle_log_line_for_chunk(self, **kwargs) -> None:
"""Find the time stamp of the first proto event in the replay file.
:param kwargs: a dictionary contains all the information about a line in the replay log.
e.g. {
Expand Down Expand Up @@ -172,7 +172,7 @@ def handle_log_line_for_bookmark(self, **kwargs) -> None:
if kwargs["protobuf_type"] == ReplayBookmark:
self.bookmark_indices.append(kwargs["timestamp"])

def finish_preprocess_replay_file(self):
def finish_preprocess_replay_file(self) -> None:
"""Finish off pre-processing and save all the pre-processing result to disk"""
# save chunk indices
if self.chunks_indices:
Expand Down Expand Up @@ -212,7 +212,7 @@ def finish_preprocess_replay_file(self):
f"Failed to build bookmark index for {self.log_folder_path} : No bookmark data found."
)

def preprocess_replay_file(self, handlers: List[Callable[[...], None]]):
def preprocess_replay_file(self, handlers: List[Callable[[...], None]]) -> None:
"""Start preprocessing replay files and build index according to the provided handlers
:param handlers: handler functions that will be applied to each line of the replay log.
Expand Down Expand Up @@ -257,7 +257,7 @@ def is_bookmark_indexed(self) -> bool:
os.path.join(self.log_folder_path, ProtoPlayer.BOOKMARK_INDEX_FILENAME)
)

def load_chunk_index(self):
def load_chunk_index(self) -> None:
"""Loads the chunk index file."""
try:
with open(
Expand All @@ -276,7 +276,7 @@ def load_chunk_index(self):
except Exception as e:
logging.warning(f"An Exception occurred when loading chunk index file {e}")

def load_bookmark_index(self):
def load_bookmark_index(self) -> None:
"""Loads the bookmark file"""
try:
with open(
Expand Down

0 comments on commit 5929f09

Please sign in to comment.