summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-21 14:41:28 -0400
committerGitHub <noreply@github.com>2018-09-21 14:41:28 -0400
commit02a319fb88dc873b8325d207213c6ef5e27779a6 (patch)
treec544b6f531feef4c983e861ad5ef5d79ce980d01 /examples
parent69b16f1631c0f808964d797d84a943c862284ab5 (diff)
parentdbe485957b421f6fd973b3a493de7b264b363d54 (diff)
downloadcmd2-git-02a319fb88dc873b8325d207213c6ef5e27779a6.tar.gz
Merge branch 'master' into colorize
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/python_scripting.py8
-rwxr-xr-xexamples/table_display.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/examples/python_scripting.py b/examples/python_scripting.py
index 069bcff5..ab5ecc2b 100755
--- a/examples/python_scripting.py
+++ b/examples/python_scripting.py
@@ -35,12 +35,12 @@ class CmdLineApp(cmd2.Cmd):
self.cwd = os.getcwd()
self.prompt = self.colorize('{!r} $ '.format(self.cwd), 'cyan')
- def postcmd(self, stop, line):
+ def postcmd(self, stop: bool, line: str) -> bool:
"""Hook method executed just after a command dispatch is finished.
- :param stop: bool - if True, the command has indicated the application should exit
- :param line: str - the command line text for this command
- :return: bool - if this is True, the application will exit after this command and the postloop() will run
+ :param stop: if True, the command has indicated the application should exit
+ :param line: the command line text for this command
+ :return: if this is True, the application will exit after this command and the postloop() will run
"""
"""Override this so prompt always displays cwd."""
self._set_prompt()
diff --git a/examples/table_display.py b/examples/table_display.py
index 75eada85..63447377 100755
--- a/examples/table_display.py
+++ b/examples/table_display.py
@@ -151,8 +151,8 @@ class TableDisplay(cmd2.Cmd):
def ptable(self, rows, columns, grid_args, row_stylist):
"""Format tabular data for pretty-printing as a fixed-width table and then display it using a pager.
- :param rows: required argument - can be a list-of-lists (or another iterable of iterables), a two-dimensional
- NumPy array, or an Iterable of non-iterable objects
+ :param rows: can be a list-of-lists (or another iterable of iterables), a two-dimensional
+ NumPy array, or an Iterable of non-iterable objects
:param columns: column headers and formatting options per column
:param grid_args: argparse arguments for formatting the grid
:param row_stylist: function to determine how each row gets styled