Skip to content

Commit

Permalink
autopep and some minor changes, created timeline selection ops in sam…
Browse files Browse the repository at this point in the history
…e fashion as noerw
  • Loading branch information
StephenMachete committed Jan 26, 2024
1 parent 542cd1c commit 00da85c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
52 changes: 26 additions & 26 deletions ptsl/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ def import_data(self,
return ImportSessionDataBuilder(self, session_path)

def import_audio(self,
file_list: List[str],
destination_path: str=None,
audio_operations: int=None,
audio_destination: int=None,
audio_location: int=None,
timecode: str=None
):
file_list: List[str],
destination_path: str = None,
audio_operations: int = None,
audio_destination: int = None,
audio_location: int = None,
timecode: str = None
):
"""
Import audio data into the currently-open session.
location_data needs to be provided regardless if empty.
Expand All @@ -235,12 +235,12 @@ def import_audio(self,
location_value=timecode
)
audio_data = pt.AudioData(file_list=file_list,

Check warning on line 237 in ptsl/engine.py

View check run for this annotation

Codecov / codecov/patch

ptsl/engine.py#L237

Added line #L237 was not covered by tests
destination_path=destination_path,
audio_operations=audio_operations,
audio_destination=audio_destination,
audio_location=audio_location,
location_data=spot_data
)
destination_path=destination_path,
audio_operations=audio_operations,
audio_destination=audio_destination,
audio_location=audio_location,
location_data=spot_data
)
op = ops.Import(import_type=1, audio_data=audio_data)
self.client.run(op)

Check warning on line 245 in ptsl/engine.py

View check run for this annotation

Codecov / codecov/patch

ptsl/engine.py#L244-L245

Added lines #L244 - L245 were not covered by tests

Expand Down Expand Up @@ -365,7 +365,7 @@ def create_memory_location(self,
"""
Create a new memory location.
"""
if general_properties == None:
if general_properties is None:
general_properties = MemoryLocationProperties(track_visibility=False)

Check warning on line 369 in ptsl/engine.py

View check run for this annotation

Codecov / codecov/patch

ptsl/engine.py#L368-L369

Added lines #L368 - L369 were not covered by tests
op = ops.CreateMemoryLocation(
number=memory_number,
Expand Down Expand Up @@ -801,7 +801,7 @@ def set_session_video_rate_pull(self, pull_rate: 'SessionRatePull'):
"""
op = ops.SetSessionVideoRatePullSettings(video_rate_pull=pull_rate)
self.client.run(op)

def simple_set_timeline_selection(self, in_time: str):
"""
Set Selection at Timecode
Expand All @@ -810,21 +810,21 @@ def simple_set_timeline_selection(self, in_time: str):
self.client.run(op)

Check warning on line 810 in ptsl/engine.py

View check run for this annotation

Codecov / codecov/patch

ptsl/engine.py#L809-L810

Added lines #L809 - L810 were not covered by tests

def create_new_tracks(self,
number_of_tracks: int = None,
track_name: str = None,
track_format: TrackFormat = None,
track_type: 'TrackType' = None,
track_timebase: TrackTimebase = None
):
number_of_tracks: int = None,
track_name: str = None,
track_format: TrackFormat = None,
track_type: 'TrackType' = None,
track_timebase: TrackTimebase = None
):
"""
Create new Tracks
"""
op = ops.CreateNewTracks(number_of_tracks=number_of_tracks,

Check warning on line 822 in ptsl/engine.py

View check run for this annotation

Codecov / codecov/patch

ptsl/engine.py#L822

Added line #L822 was not covered by tests
track_name=track_name,
track_format=track_format,
track_type=track_type,
track_timebase=track_timebase
)
track_name=track_name,
track_format=track_format,
track_type=track_type,
track_timebase=track_timebase
)
self.client.run(op)

Check warning on line 828 in ptsl/engine.py

View check run for this annotation

Codecov / codecov/patch

ptsl/engine.py#L828

Added line #L828 was not covered by tests

def cut(self, special: Optional['AutomationDataOptions'] = None):
Expand Down
7 changes: 5 additions & 2 deletions ptsl/ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@
TogglePlayState, ToggleRecordEnable, \
PlayHalfSpeed, RecordHalfSpeed

from .memory_locations import EditMemoryLocation, GetMemoryLocations, CreateMemoryLocation

from .set_timeline_selection import SetTimelineSelection

from .memory_locations import EditMemoryLocation, \
GetMemoryLocations, CreateMemoryLocation

from .timeline_selection import SetTimelineSelection, GetTimelineSelection
from .create_new_tracks import CreateNewTracks

Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from ptsl.ops import Operation


class GetTimelineSelection(Operation):
pass

class SetTimelineSelection(Operation):
pass

0 comments on commit 00da85c

Please sign in to comment.