Skip to content

Commit

Permalink
flake8 tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
iluvcapra committed Apr 11, 2024
1 parent 835d148 commit b5cda96
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
14 changes: 9 additions & 5 deletions ptsl/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
PasteSpecialOptions, TrackOffsetOptions, TrackListInvertibleFilter, \
ExportFileType, ResolveDuplicateNamesBy, ExportFormat, \
MemoryLocationReference, MemoryLocationProperties, \
TimeProperties, CL_ClipLocation
TimeProperties, CL_ClipLocation, SelectionMode


@contextmanager
Expand Down Expand Up @@ -836,21 +836,24 @@ def refresh_all_modified_audio_files(self):
self.client.run(ops.RefreshAllModifiedAudioFiles())

# PT 2023.9
# TODO add remaining new methods, add proper docstrings, expose remaining parameters
# TODO add remaining new methods, add proper docstrings, expose
# remaining parameters
# CreateNewTracks
# GetEditMode, SetEditMode, GetEditModeOptions, SetEditModeOptions
# GetEditTool, SetEditTool
# RecallZoomPreset

def select_tracks_by_name(self, names: List[str], mode: Optional['SelectionMode'] = pt.SM_Replace):
def select_tracks_by_name(self, names: List[str],
mode: Optional['SelectionMode'] = pt.SM_Replace):
"""
Selects all tracks matching any of the passed names literally.
"""
# TODO: handle pagination request?
op = ops.SelectTracksByName(track_names=names, selection_mode=mode)
self.client.run(op)

def set_timeline_selection(self, start: str, end: str, playhead_time: Optional[str]):
def set_timeline_selection(self, start: str, end: str,
playhead_time: Optional[str]):
"""
Sets temporal selection range
"""
Expand All @@ -876,7 +879,8 @@ def set_timeline_selection(self, start: str, end: str, playhead_time: Optional[s

def get_timeline_selection(self) -> pt.GetTimelineSelectionResponseBody:
"""
Returns data about the current temporal selection, including pre/post-roll settings
Returns data about the current temporal selection, including
pre/post-roll settings.
"""
op = ops.GetMemoryLocations()
self.client.run(op)
Expand Down
3 changes: 2 additions & 1 deletion ptsl/ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@

from .create_new_tracks import CreateNewTracks
from .select_tracks import SelectTracksByName
from .edit_mode import GetEditMode, SetEditMode, GetEditModeOptions, SetEditModeOptions
from .edit_mode import GetEditMode, SetEditMode, GetEditModeOptions, \
SetEditModeOptions
from .edit_tool import GetEditTool, SetEditTool
from .zoom_preset import RecallZoomPreset
from .timeline_selection import SetTimelineSelection, GetTimelineSelection
3 changes: 3 additions & 0 deletions ptsl/ops/edit_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
class GetEditMode(Operation):
pass


class SetEditMode(Operation):
pass


class GetEditModeOptions(Operation):
pass


class SetEditModeOptions(Operation):
pass
1 change: 1 addition & 0 deletions ptsl/ops/edit_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
class GetEditTool(Operation):
pass


class SetEditTool(Operation):
pass
1 change: 1 addition & 0 deletions ptsl/ops/timeline_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
class GetTimelineSelection(Operation):
pass


class SetTimelineSelection(Operation):
pass

0 comments on commit b5cda96

Please sign in to comment.