summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/alias_startup.py2
-rwxr-xr-xexamples/arg_print.py2
-rwxr-xr-xexamples/async_printing.py14
-rwxr-xr-xexamples/cmd_as_argument.py2
-rwxr-xr-xexamples/decorator_example.py2
-rwxr-xr-xexamples/environment.py2
-rwxr-xr-xexamples/example.py2
-rwxr-xr-xexamples/exit_code.py2
-rwxr-xr-xexamples/help_categories.py2
-rwxr-xr-xexamples/migrating.py2
-rwxr-xr-xexamples/paged_output.py2
-rwxr-xr-xexamples/python_scripting.py2
-rwxr-xr-xexamples/remove_builtin_commands.py2
13 files changed, 19 insertions, 19 deletions
diff --git a/examples/alias_startup.py b/examples/alias_startup.py
index 3ddcc2fe..72e969fc 100755
--- a/examples/alias_startup.py
+++ b/examples/alias_startup.py
@@ -10,7 +10,7 @@ import cmd2
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')
diff --git a/examples/arg_print.py b/examples/arg_print.py
index 6736c74f..9663a67a 100755
--- a/examples/arg_print.py
+++ b/examples/arg_print.py
@@ -15,7 +15,7 @@ import cmd2
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
diff --git a/examples/async_printing.py b/examples/async_printing.py
index bcdbc8f0..4832bf0a 100755
--- a/examples/async_printing.py
+++ b/examples/async_printing.py
@@ -32,10 +32,10 @@ ALERTS = [
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)> "
@@ -51,7 +51,7 @@ class AlerterApp(cmd2.Cmd):
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
@@ -62,7 +62,7 @@ class AlerterApp(cmd2.Cmd):
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.
@@ -72,7 +72,7 @@ class AlerterApp(cmd2.Cmd):
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:
@@ -81,7 +81,7 @@ class AlerterApp(cmd2.Cmd):
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()
@@ -167,7 +167,7 @@ class AlerterApp(cmd2.Cmd):
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
diff --git a/examples/cmd_as_argument.py b/examples/cmd_as_argument.py
index 39332203..88010668 100755
--- a/examples/cmd_as_argument.py
+++ b/examples/cmd_as_argument.py
@@ -19,7 +19,7 @@ import cmd2
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
diff --git a/examples/decorator_example.py b/examples/decorator_example.py
index 6a5e6b10..6848335c 100755
--- a/examples/decorator_example.py
+++ b/examples/decorator_example.py
@@ -19,7 +19,7 @@ import cmd2
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)
diff --git a/examples/environment.py b/examples/environment.py
index 151c55af..3eaaa8d1 100755
--- a/examples/environment.py
+++ b/examples/environment.py
@@ -7,7 +7,7 @@ import cmd2
class EnvironmentApp(cmd2.Cmd):
- """ Example cmd2 application. """
+ """Example cmd2 application."""
def __init__(self):
super().__init__()
diff --git a/examples/example.py b/examples/example.py
index a3d4e90b..4c527076 100755
--- a/examples/example.py
+++ b/examples/example.py
@@ -17,7 +17,7 @@ import cmd2
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
diff --git a/examples/exit_code.py b/examples/exit_code.py
index 440fc595..23b172a1 100755
--- a/examples/exit_code.py
+++ b/examples/exit_code.py
@@ -10,7 +10,7 @@ import cmd2
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__()
diff --git a/examples/help_categories.py b/examples/help_categories.py
index 80c976c1..c5c9af86 100755
--- a/examples/help_categories.py
+++ b/examples/help_categories.py
@@ -23,7 +23,7 @@ def my_decorator(f):
class HelpCategories(cmd2.Cmd):
- """ Example cmd2 application. """
+ """Example cmd2 application."""
START_TIMES = ['now', 'later', 'sometime', 'whenever']
diff --git a/examples/migrating.py b/examples/migrating.py
index e7c2f19e..fab40d25 100755
--- a/examples/migrating.py
+++ b/examples/migrating.py
@@ -8,7 +8,7 @@ import random
class CmdLineApp(cmd.Cmd):
- """ Example cmd application. """
+ """Example cmd application."""
MUMBLES = ['like', '...', 'um', 'er', 'hmmm', 'ahh']
MUMBLE_FIRST = ['so', 'like', 'well']
diff --git a/examples/paged_output.py b/examples/paged_output.py
index 796f47a8..afed8a6e 100755
--- a/examples/paged_output.py
+++ b/examples/paged_output.py
@@ -11,7 +11,7 @@ import cmd2
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__()
diff --git a/examples/python_scripting.py b/examples/python_scripting.py
index 33d8010d..7e729202 100755
--- a/examples/python_scripting.py
+++ b/examples/python_scripting.py
@@ -30,7 +30,7 @@ from cmd2 import (
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
diff --git a/examples/remove_builtin_commands.py b/examples/remove_builtin_commands.py
index b0b19447..67541a84 100755
--- a/examples/remove_builtin_commands.py
+++ b/examples/remove_builtin_commands.py
@@ -13,7 +13,7 @@ import cmd2
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__()