Skip to content

Commit

Permalink
Style changes from running black on Python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
kmvanbrunt committed Apr 27, 2021
1 parent fe2f5bd commit a6dcc37
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion examples/alias_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class AliasAndStartup(cmd2.Cmd):
""" Example cmd2 application where we create commands that just print the arguments they are called with."""
"""Example cmd2 application where we create commands that just print the arguments they are called with."""

def __init__(self):
alias_script = os.path.join(os.path.dirname(__file__), '.cmd2rc')
Expand Down
2 changes: 1 addition & 1 deletion examples/arg_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


class ArgumentAndOptionPrinter(cmd2.Cmd):
""" Example cmd2 application where we create commands that just print the arguments they are called with."""
"""Example cmd2 application where we create commands that just print the arguments they are called with."""

def __init__(self):
# Create command shortcuts which are typically 1 character abbreviations which can be used in place of a command
Expand Down
14 changes: 7 additions & 7 deletions examples/async_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@


class AlerterApp(cmd2.Cmd):
""" An app that shows off async_alert() and async_update_prompt() """
"""An app that shows off async_alert() and async_update_prompt()"""

def __init__(self, *args, **kwargs) -> None:
""" Initializer """
"""Initializer"""
super().__init__(*args, **kwargs)

self.prompt = "(APR)> "
Expand All @@ -51,7 +51,7 @@ def __init__(self, *args, **kwargs) -> None:
self.register_postloop_hook(self._postloop_hook)

def _preloop_hook(self) -> None:
""" Start the alerter thread """
"""Start the alerter thread"""
# This runs after cmdloop() acquires self.terminal_lock, which will be locked until the prompt appears.
# Therefore this is the best place to start the alerter thread since there is no risk of it alerting
# before the prompt is displayed. You can also start it via a command if its not something that should
Expand All @@ -62,7 +62,7 @@ def _preloop_hook(self) -> None:
self._alerter_thread.start()

def _postloop_hook(self) -> None:
""" Stops the alerter thread """
"""Stops the alerter thread"""

# After this function returns, cmdloop() releases self.terminal_lock which could make the alerter
# thread think the prompt is on screen. Therefore this is the best place to stop the alerter thread.
Expand All @@ -72,7 +72,7 @@ def _postloop_hook(self) -> None:
self._alerter_thread.join()

def do_start_alerts(self, _):
""" Starts the alerter thread """
"""Starts the alerter thread"""
if self._alerter_thread.is_alive():
print("The alert thread is already started")
else:
Expand All @@ -81,7 +81,7 @@ def do_start_alerts(self, _):
self._alerter_thread.start()

def do_stop_alerts(self, _):
""" Stops the alerter thread """
"""Stops the alerter thread"""
self._stop_event.set()
if self._alerter_thread.is_alive():
self._alerter_thread.join()
Expand Down Expand Up @@ -167,7 +167,7 @@ def _generate_colored_prompt(self) -> str:
return style(self.visible_prompt, fg=status_color)

def _alerter_thread_func(self) -> None:
""" Prints alerts and updates the prompt any time the prompt is showing """
"""Prints alerts and updates the prompt any time the prompt is showing"""

self._alert_count = 0
self._next_alert_time = 0
Expand Down
2 changes: 1 addition & 1 deletion examples/cmd_as_argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


class CmdLineApp(cmd2.Cmd):
""" Example cmd2 application. """
"""Example cmd2 application."""

# Setting this true makes it run a shell command if a cmd2/cmd command doesn't exist
# default_to_shell = True
Expand Down
2 changes: 1 addition & 1 deletion examples/decorator_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


class CmdLineApp(cmd2.Cmd):
""" Example cmd2 application. """
"""Example cmd2 application."""

def __init__(self, ip_addr=None, port=None, transcript_files=None):
shortcuts = dict(cmd2.DEFAULT_SHORTCUTS)
Expand Down
2 changes: 1 addition & 1 deletion examples/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


class EnvironmentApp(cmd2.Cmd):
""" Example cmd2 application. """
"""Example cmd2 application."""

def __init__(self):
super().__init__()
Expand Down
2 changes: 1 addition & 1 deletion examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


class CmdLineApp(cmd2.Cmd):
""" Example cmd2 application. """
"""Example cmd2 application."""

# Setting this true makes it run a shell command if a cmd2/cmd command doesn't exist
# default_to_shell = True
Expand Down
2 changes: 1 addition & 1 deletion examples/exit_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class ReplWithExitCode(cmd2.Cmd):
""" Example cmd2 application where we can specify an exit code when existing."""
"""Example cmd2 application where we can specify an exit code when existing."""

def __init__(self):
super().__init__()
Expand Down
2 changes: 1 addition & 1 deletion examples/help_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def wrapper(*args, **kwds):


class HelpCategories(cmd2.Cmd):
""" Example cmd2 application. """
"""Example cmd2 application."""

START_TIMES = ['now', 'later', 'sometime', 'whenever']

Expand Down
2 changes: 1 addition & 1 deletion examples/migrating.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class CmdLineApp(cmd.Cmd):
""" Example cmd application. """
"""Example cmd application."""

MUMBLES = ['like', '...', 'um', 'er', 'hmmm', 'ahh']
MUMBLE_FIRST = ['so', 'like', 'well']
Expand Down
2 changes: 1 addition & 1 deletion examples/paged_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class PagedOutput(cmd2.Cmd):
""" Example cmd2 application which shows how to display output using a pager."""
"""Example cmd2 application which shows how to display output using a pager."""

def __init__(self):
super().__init__()
Expand Down
2 changes: 1 addition & 1 deletion examples/python_scripting.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


class CmdLineApp(cmd2.Cmd):
""" Example cmd2 application to showcase conditional control flow in Python scripting within cmd2 apps."""
"""Example cmd2 application to showcase conditional control flow in Python scripting within cmd2 apps."""

def __init__(self):
# Set include_ipy to True to enable the "ipy" command which runs an interactive IPython shell
Expand Down
2 changes: 1 addition & 1 deletion examples/remove_builtin_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class RemoveBuiltinCommands(cmd2.Cmd):
""" Example cmd2 application where we remove some unused built-in commands."""
"""Example cmd2 application where we remove some unused built-in commands."""

def __init__(self):
super().__init__()
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def normalize(block):


def run_cmd(app, cmd):
""" Clear out and err StdSim buffers, run the command, and return out and err """
"""Clear out and err StdSim buffers, run the command, and return out and err"""
saved_sysout = sys.stdout
sys.stdout = app.stdout

Expand Down
2 changes: 1 addition & 1 deletion tests/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def test_preservelist(argparse_app):


class SubcommandApp(cmd2.Cmd):
""" Example cmd2 application where we a base command which has a couple subcommands."""
"""Example cmd2 application where we a base command which has a couple subcommands."""

def __init__(self):
cmd2.Cmd.__init__(self)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2304,7 +2304,7 @@ def help_my_cmd(self, args):


class ReplWithExitCode(cmd2.Cmd):
""" Example cmd2 application where we can specify an exit code when existing."""
"""Example cmd2 application where we can specify an exit code when existing."""

def __init__(self):
super().__init__(allow_cli_args=False)
Expand Down
2 changes: 1 addition & 1 deletion tests_isolated/test_commandset/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def normalize(block):


def run_cmd(app, cmd):
""" Clear out and err StdSim buffers, run the command, and return out and err """
"""Clear out and err StdSim buffers, run the command, and return out and err"""
saved_sysout = sys.stdout
sys.stdout = app.stdout

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


class SubcommandSet(cmd2.CommandSet):
""" Example cmd2 application where we a base command which has a couple subcommands."""
"""Example cmd2 application where we a base command which has a couple subcommands."""

def __init__(self, dummy):
super(SubcommandSet, self).__init__()
Expand Down

0 comments on commit a6dcc37

Please sign in to comment.