summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/async_printing.py4
-rwxr-xr-xexamples/basic_completion.py4
-rwxr-xr-xexamples/colors.py8
-rwxr-xr-xexamples/decorator_example.py4
-rwxr-xr-xexamples/exit_code.py4
-rwxr-xr-xexamples/hello_cmd2.py5
-rwxr-xr-xexamples/help_categories.py4
-rwxr-xr-xexamples/hooks.py4
-rw-r--r--examples/modular_commands/commandset_basic.py8
-rw-r--r--examples/modular_commands/commandset_complex.py8
-rw-r--r--examples/modular_commands_main.py13
-rwxr-xr-xexamples/override_parser.py4
-rwxr-xr-xexamples/paged_output.py4
-rwxr-xr-xexamples/pirate.py4
-rwxr-xr-xexamples/plumbum_colors.py7
-rwxr-xr-xexamples/python_scripting.py4
-rwxr-xr-xexamples/table_creation.py4
17 files changed, 69 insertions, 24 deletions
diff --git a/examples/async_printing.py b/examples/async_printing.py
index 641ff84f..74c4f41f 100755
--- a/examples/async_printing.py
+++ b/examples/async_printing.py
@@ -7,7 +7,9 @@ and changes the window title
import random
import threading
import time
-from typing import List
+from typing import (
+ List,
+)
import cmd2
from cmd2 import (
diff --git a/examples/basic_completion.py b/examples/basic_completion.py
index aab7d3d1..febe58a3 100755
--- a/examples/basic_completion.py
+++ b/examples/basic_completion.py
@@ -13,7 +13,9 @@ familiar with argparse. The recommended approach for tab completing positional t
argparse-based completion. For an example integrating tab completion with argparse, see argparse_completion.py
"""
import functools
-from typing import List
+from typing import (
+ List,
+)
import cmd2
diff --git a/examples/colors.py b/examples/colors.py
index 60a75a53..abfb8955 100755
--- a/examples/colors.py
+++ b/examples/colors.py
@@ -24,7 +24,9 @@ Always
regardless of the output destination
"""
import argparse
-from typing import Any
+from typing import (
+ Any,
+)
from colorama import (
Back,
@@ -33,7 +35,9 @@ from colorama import (
)
import cmd2
-from cmd2 import ansi
+from cmd2 import (
+ ansi,
+)
class CmdLineApp(cmd2.Cmd):
diff --git a/examples/decorator_example.py b/examples/decorator_example.py
index c20a6d4a..09193926 100755
--- a/examples/decorator_example.py
+++ b/examples/decorator_example.py
@@ -11,7 +11,9 @@ all the commands in the transcript against decorator_example.py,
verifying that the output produced matches the transcript.
"""
import argparse
-from typing import List
+from typing import (
+ List,
+)
import cmd2
diff --git a/examples/exit_code.py b/examples/exit_code.py
index 9f940f69..80cef62f 100755
--- a/examples/exit_code.py
+++ b/examples/exit_code.py
@@ -2,7 +2,9 @@
# coding=utf-8
"""A simple example demonstrating the following how to emit a non-zero exit code in your cmd2 application.
"""
-from typing import List
+from typing import (
+ List,
+)
import cmd2
diff --git a/examples/hello_cmd2.py b/examples/hello_cmd2.py
index 19d369da..e94ad2a5 100755
--- a/examples/hello_cmd2.py
+++ b/examples/hello_cmd2.py
@@ -3,13 +3,14 @@
"""
This is intended to be a completely bare-bones cmd2 application suitable for rapid testing and debugging.
"""
-from cmd2 import cmd2
+from cmd2 import (
+ cmd2,
+)
if __name__ == '__main__':
import sys
# If run as the main application, simply start a bare-bones cmd2 application with only built-in functionality.
-
# Set "use_ipython" to True to include the ipy command if IPython is installed, which supports advanced interactive
# debugging of your application via introspection on self.
app = cmd2.Cmd(use_ipython=True, persistent_history_file='cmd2_history.dat')
diff --git a/examples/help_categories.py b/examples/help_categories.py
index 16860ec2..d9a7cce2 100755
--- a/examples/help_categories.py
+++ b/examples/help_categories.py
@@ -8,7 +8,9 @@ It also demonstrates the effects of decorator order when it comes to argparse er
import functools
import cmd2
-from cmd2 import COMMAND_NAME
+from cmd2 import (
+ COMMAND_NAME,
+)
def my_decorator(f):
diff --git a/examples/hooks.py b/examples/hooks.py
index 55b43e5d..e83c77fb 100755
--- a/examples/hooks.py
+++ b/examples/hooks.py
@@ -10,7 +10,9 @@ follow a command without any intervening whitespace.
"""
import re
-from typing import List
+from typing import (
+ List,
+)
import cmd2
diff --git a/examples/modular_commands/commandset_basic.py b/examples/modular_commands/commandset_basic.py
index c3ab41f2..226703b8 100644
--- a/examples/modular_commands/commandset_basic.py
+++ b/examples/modular_commands/commandset_basic.py
@@ -2,7 +2,9 @@
"""
A simple example demonstrating a loadable command set
"""
-from typing import List
+from typing import (
+ List,
+)
from cmd2 import (
Cmd,
@@ -11,7 +13,9 @@ from cmd2 import (
with_category,
with_default_category,
)
-from cmd2.utils import CompletionError
+from cmd2.utils import (
+ CompletionError,
+)
@with_default_category('Basic Completion')
diff --git a/examples/modular_commands/commandset_complex.py b/examples/modular_commands/commandset_complex.py
index 03bc2507..a9c39e55 100644
--- a/examples/modular_commands/commandset_complex.py
+++ b/examples/modular_commands/commandset_complex.py
@@ -5,10 +5,14 @@ Test CommandSet
"""
import argparse
-from typing import List
+from typing import (
+ List,
+)
import cmd2
-from cmd2 import utils
+from cmd2 import (
+ utils,
+)
@cmd2.with_default_category('Fruits')
diff --git a/examples/modular_commands_main.py b/examples/modular_commands_main.py
index ae1c64f7..16b0a798 100644
--- a/examples/modular_commands_main.py
+++ b/examples/modular_commands_main.py
@@ -12,6 +12,16 @@ from typing import (
Optional,
)
+from modular_commands.commandset_basic import ( # noqa: F401
+ BasicCompletionCommandSet,
+)
+from modular_commands.commandset_complex import ( # noqa: F401
+ CommandSetA,
+)
+from modular_commands.commandset_custominit import ( # noqa: F401
+ CustomInitCommandSet,
+)
+
from cmd2 import (
Cmd,
Cmd2ArgumentParser,
@@ -23,9 +33,6 @@ from cmd2.utils import (
CompletionError,
basic_complete,
)
-from modular_commands.commandset_basic import BasicCompletionCommandSet # noqa: F401
-from modular_commands.commandset_complex import CommandSetA # noqa: F401
-from modular_commands.commandset_custominit import CustomInitCommandSet # noqa: F401
# Data source for argparse.choices
food_item_strs = ['Pizza', 'Ham', 'Ham Sandwich', 'Potato']
diff --git a/examples/override_parser.py b/examples/override_parser.py
index d7d45b82..f615e6e0 100755
--- a/examples/override_parser.py
+++ b/examples/override_parser.py
@@ -13,7 +13,9 @@ import argparse
# Next import stuff from cmd2. It will import your module just before the cmd2.Cmd class file is imported
# and therefore override the parser class it uses on its commands.
-from cmd2 import cmd2
+from cmd2 import (
+ cmd2,
+)
argparse.cmd2_parser_module = 'examples.custom_parser'
diff --git a/examples/paged_output.py b/examples/paged_output.py
index 1c323c61..796f47a8 100755
--- a/examples/paged_output.py
+++ b/examples/paged_output.py
@@ -3,7 +3,9 @@
"""A simple example demonstrating the using paged output via the ppaged() method.
"""
import os
-from typing import List
+from typing import (
+ List,
+)
import cmd2
diff --git a/examples/pirate.py b/examples/pirate.py
index 52e96de2..7b92b6f0 100755
--- a/examples/pirate.py
+++ b/examples/pirate.py
@@ -10,7 +10,9 @@ import argparse
import cmd2
import cmd2.ansi
-from cmd2.constants import MULTILINE_TERMINATOR
+from cmd2.constants import (
+ MULTILINE_TERMINATOR,
+)
class Pirate(cmd2.Cmd):
diff --git a/examples/plumbum_colors.py b/examples/plumbum_colors.py
index 2be7f156..a7cb7e88 100755
--- a/examples/plumbum_colors.py
+++ b/examples/plumbum_colors.py
@@ -27,13 +27,16 @@ WARNING: This example requires the plumbum package, which isn't normally require
"""
import argparse
-import cmd2
-from cmd2 import ansi
from plumbum.colors import (
bg,
fg,
)
+import cmd2
+from cmd2 import (
+ ansi,
+)
+
class FgColors(ansi.ColorBase):
black = fg.Black
diff --git a/examples/python_scripting.py b/examples/python_scripting.py
index 3aa61467..bb43095e 100755
--- a/examples/python_scripting.py
+++ b/examples/python_scripting.py
@@ -24,7 +24,9 @@ import argparse
import os
import cmd2
-from cmd2 import ansi
+from cmd2 import (
+ ansi,
+)
class CmdLineApp(cmd2.Cmd):
diff --git a/examples/table_creation.py b/examples/table_creation.py
index bd955580..ff72311a 100755
--- a/examples/table_creation.py
+++ b/examples/table_creation.py
@@ -8,7 +8,9 @@ from typing import (
List,
)
-from cmd2 import ansi
+from cmd2 import (
+ ansi,
+)
from cmd2.table_creator import (
AlternatingTable,
BorderedTable,