Add type hints for profiling calls
This commit is contained in:
parent
4860c9f188
commit
07d8ce9c41
@ -567,7 +567,7 @@ class PlaylistRows(dbtables.PlaylistRowsTable):
|
|||||||
session: Session,
|
session: Session,
|
||||||
playlist_id: int,
|
playlist_id: int,
|
||||||
sqla_map: List[dict[str, int]],
|
sqla_map: List[dict[str, int]],
|
||||||
dummy_for_profiling=None,
|
dummy_for_profiling: Optional[int] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Take a {plrid: row_number} dictionary and update the row numbers accordingly
|
Take a {plrid: row_number} dictionary and update the row numbers accordingly
|
||||||
|
|||||||
@ -1066,7 +1066,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
webbrowser.get("browser").open_new_tab(url)
|
webbrowser.get("browser").open_new_tab(url)
|
||||||
|
|
||||||
@line_profiler.profile
|
@line_profiler.profile
|
||||||
def paste_rows(self, dummy_for_profiling=None) -> None:
|
def paste_rows(self, dummy_for_profiling: Optional[int] = None) -> None:
|
||||||
"""
|
"""
|
||||||
Paste earlier cut rows.
|
Paste earlier cut rows.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@ -747,7 +747,10 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
|
|
||||||
@line_profiler.profile
|
@line_profiler.profile
|
||||||
def move_rows(
|
def move_rows(
|
||||||
self, from_rows: list[int], to_row_number: int, dummy_for_profiling=None
|
self,
|
||||||
|
from_rows: list[int],
|
||||||
|
to_row_number: int,
|
||||||
|
dummy_for_profiling: Optional[int] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Move the playlist rows given to to_row and below.
|
Move the playlist rows given to to_row and below.
|
||||||
@ -819,7 +822,7 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
from_rows: list[int],
|
from_rows: list[int],
|
||||||
to_row_number: int,
|
to_row_number: int,
|
||||||
to_playlist_id: int,
|
to_playlist_id: int,
|
||||||
dummy_for_profiling=None,
|
dummy_for_profiling: Optional[int] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Move the playlist rows given to to_row and below of to_playlist.
|
Move the playlist rows given to to_row and below of to_playlist.
|
||||||
@ -992,7 +995,9 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
self.invalidate_row(track_sequence.previous.row_number)
|
self.invalidate_row(track_sequence.previous.row_number)
|
||||||
|
|
||||||
@line_profiler.profile
|
@line_profiler.profile
|
||||||
def refresh_data(self, session: db.session, dummy_for_profiling=None) -> None:
|
def refresh_data(
|
||||||
|
self, session: db.session, dummy_for_profiling: Optional[int] = None
|
||||||
|
) -> None:
|
||||||
"""Populate self.playlist_rows with playlist data"""
|
"""Populate self.playlist_rows with playlist data"""
|
||||||
|
|
||||||
# We used to clear self.playlist_rows each time but that's
|
# We used to clear self.playlist_rows each time but that's
|
||||||
@ -1019,7 +1024,9 @@ class PlaylistModel(QAbstractTableModel):
|
|||||||
# Same as refresh data, but only used when creating playslit.
|
# Same as refresh data, but only used when creating playslit.
|
||||||
# Distinguishes profile time between initial load and other
|
# Distinguishes profile time between initial load and other
|
||||||
# refreshes.
|
# refreshes.
|
||||||
def load_data(self, session: db.session, dummy_for_profiling=None) -> None:
|
def load_data(
|
||||||
|
self, session: db.session, dummy_for_profiling: Optional[int] = None
|
||||||
|
) -> None:
|
||||||
"""Populate self.playlist_rows with playlist data"""
|
"""Populate self.playlist_rows with playlist data"""
|
||||||
|
|
||||||
# We used to clear self.playlist_rows each time but that's
|
# We used to clear self.playlist_rows each time but that's
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user