summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd2/argparse_completer.py4
-rw-r--r--cmd2/py_bridge.py2
-rw-r--r--cmd2/utils.py10
-rwxr-xr-xexamples/table_display.py2
-rw-r--r--tests/conftest.py2
5 files changed, 10 insertions, 10 deletions
diff --git a/cmd2/argparse_completer.py b/cmd2/argparse_completer.py
index 23fd930e..6513fe13 100644
--- a/cmd2/argparse_completer.py
+++ b/cmd2/argparse_completer.py
@@ -64,10 +64,10 @@ def _looks_like_flag(token: str, parser: argparse.ArgumentParser) -> bool:
# noinspection PyProtectedMember
-class AutoCompleter(object):
+class AutoCompleter:
"""Automatic command line tab completion based on argparse parameters"""
- class _ArgumentState(object):
+ class _ArgumentState:
"""Keeps state of an argument being parsed"""
def __init__(self, arg_action: argparse.Action) -> None:
diff --git a/cmd2/py_bridge.py b/cmd2/py_bridge.py
index 0a1b6ee7..b7346d22 100644
--- a/cmd2/py_bridge.py
+++ b/cmd2/py_bridge.py
@@ -53,7 +53,7 @@ class CommandResult(namedtuple_with_defaults('CommandResult', ['stdout', 'stderr
return not self.stderr
-class PyBridge(object):
+class PyBridge:
"""Provides a Python API wrapper for application commands."""
def __init__(self, cmd2_app):
self._cmd2_app = cmd2_app
diff --git a/cmd2/utils.py b/cmd2/utils.py
index c200085a..ee53e924 100644
--- a/cmd2/utils.py
+++ b/cmd2/utils.py
@@ -388,7 +388,7 @@ def get_exes_in_path(starts_with: str) -> List[str]:
return list(exes_set)
-class StdSim(object):
+class StdSim:
"""
Class to simulate behavior of sys.stdout or sys.stderr.
Stores contents in internal buffer and optionally echos to the inner stream it is simulating.
@@ -468,7 +468,7 @@ class StdSim(object):
return getattr(self.inner_stream, item)
-class ByteBuf(object):
+class ByteBuf:
"""
Used by StdSim to write binary data and stores the actual bytes written
"""
@@ -497,7 +497,7 @@ class ByteBuf(object):
self.std_sim_instance.flush()
-class ProcReader(object):
+class ProcReader:
"""
Used to capture stdout and stderr from a Popen process if any of those were set to subprocess.PIPE.
If neither are pipes, then the process will run normally and no output will be captured.
@@ -599,7 +599,7 @@ class ProcReader(object):
pass
-class ContextFlag(object):
+class ContextFlag:
"""A context manager which is also used as a boolean flag value within the default sigint handler.
Its main use is as a flag to prevent the SIGINT handler in cmd2 from raising a KeyboardInterrupt
@@ -623,7 +623,7 @@ class ContextFlag(object):
raise ValueError("count has gone below 0")
-class RedirectionSavedState(object):
+class RedirectionSavedState:
"""Created by each command to store information about their redirection."""
def __init__(self, self_stdout: Union[StdSim, TextIO], sys_stdout: Union[StdSim, TextIO],
diff --git a/examples/table_display.py b/examples/table_display.py
index a8fd2cb0..01143598 100755
--- a/examples/table_display.py
+++ b/examples/table_display.py
@@ -77,7 +77,7 @@ COLUMNS = [tf.Column('City', width=11, header_halign=tf.ColumnAlignment.AlignCen
# ######## Table data formatted as an iterable of python objects #########
-class CityInfo(object):
+class CityInfo:
"""City information container"""
def __init__(self, city: str, province: str, country: str, continent: str, population: int, area: float):
self.city = city
diff --git a/tests/conftest.py b/tests/conftest.py
index 51345881..9e3e2798 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -102,7 +102,7 @@ SHOW_LONG = """
allow_style: 'Terminal' # Allow ANSI text style sequences in output (valid values: Terminal, Always, Never)
debug: False # Show full error stack on error
echo: False # Echo command issued into output
-editor: 'vim' # Program used by `edit`
+editor: 'vim' # Program used by 'edit'
feedback_to_output: False # Include nonessentials in '|', '>' results
max_completion_items: 50 # Maximum number of CompletionItems to display during tab completion
quiet: False # Don't print nonessential feedback