diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-02-04 23:36:49 -0500 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-02-04 23:36:49 -0500 |
| commit | d812fbc4d6dbd31c643caf4f8561f47ee8cb58aa (patch) | |
| tree | cf4e4e3440fce1c98084d31e05194fe4265cdf9a /cmd2 | |
| parent | ed83f7cfedfdcf8620e0feb9a8c6b98cd69dda16 (diff) | |
| download | cmd2-git-d812fbc4d6dbd31c643caf4f8561f47ee8cb58aa.tar.gz | |
Removed unnecessary inheritance from object
Diffstat (limited to 'cmd2')
| -rw-r--r-- | cmd2/argparse_completer.py | 4 | ||||
| -rw-r--r-- | cmd2/py_bridge.py | 2 | ||||
| -rw-r--r-- | cmd2/utils.py | 10 |
3 files changed, 8 insertions, 8 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], |
