Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
iluvcapra committed Nov 22, 2024
1 parent 00fe81b commit 57f5cde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions examples/toolshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

class ToolShell(cmd.Cmd):
intro = """
Toolshell is a demonstration command interpreter that
can remotely operate Pro Tools. Type `help` or `?` to
Toolshell is a demonstration command interpreter that
can remotely operate Pro Tools. Type `help` or `?` to
list commands.
To begin, type `connect`.
Expand All @@ -20,7 +20,8 @@ class ToolShell(cmd.Cmd):

client = None

def run_command_on_session(self, command_id: pt.CommandId, args: dict) -> Optional[dict]:
def run_command_on_session(self, command_id: pt.CommandId,
args: dict) -> Optional[dict]:
if self.client is None:
print("Command failed, not connected")
return None
Expand All @@ -32,7 +33,7 @@ def run_command_on_session(self, command_id: pt.CommandId, args: dict) -> Option
if e.error_type == pt.PT_NoOpenedSession:
print("command failed, no session is currently open")
return None
except:
except Exception:
print("Command failed, Pro Tools may not be running")
return None

Expand All @@ -41,7 +42,7 @@ def do_connect(self, _):
self.client = ptsl.client.Client(company_name="py-ptsl",
application_name="Toolshell")
if self.client is not None:
self.prompt = f"(pt/connected) "
self.prompt = "(pt/connected) "

def do_sinfo(self, _):
'Print info about the open session: SINFO'
Expand Down Expand Up @@ -75,7 +76,7 @@ def do_newsession(self, args):
self.client.run_command(pt.CreateSession, command_args)

def do_locate(self, args):
'Locate to a given time in the current main counter format: LOCATE time'
'Locate to a given time: LOCATE time'
time = args.strip()
command_args = {'play_start_marker_time': time,
'in_time': time,
Expand Down
4 changes: 2 additions & 2 deletions ptsl/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from ptsl import PTSL_pb2_grpc
from ptsl import PTSL_pb2 as pt
from ptsl.errors import CommandError
from ptsl.ops import Operation
from ptsl.ops import Operation


PTSL_VERSION = 5
Expand Down Expand Up @@ -137,7 +137,7 @@ def __init__(self,

raise grpc_error

def run_command(self, command_id: pt.CommandId,
def run_command(self, command_id: pt.CommandId,
request: dict) -> Optional[dict]:
"""
Run a command on the client with a JSON request.
Expand Down

0 comments on commit 57f5cde

Please sign in to comment.