diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-19 10:37:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-19 10:37:12 -0400 |
commit | f787b1fb0adc8596d338af9cebdf3866e75fdbaa (patch) | |
tree | 603ea6c1ec84267d524daa46886ead0cb400b042 /cmd2/cmd2.py | |
parent | 2d82b8f49d212b06c33ed06fb9db5465aa7a8b95 (diff) | |
parent | b1a6dd3bdb27590aec4612ba4bd58eb416a60d07 (diff) | |
download | cmd2-git-f787b1fb0adc8596d338af9cebdf3866e75fdbaa.tar.gz |
Merge branch 'master' into colorize
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 136328b1..db96228b 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -1574,7 +1574,7 @@ class Cmd(cmd.Cmd): def get_all_commands(self) -> List[str]: """Returns a list of all commands.""" return [name[3:] for name in self.get_names() - if name.startswith('do_') and isinstance(getattr(self, name), Callable)] + if name.startswith('do_') and callable(getattr(self, name))] def get_visible_commands(self) -> List[str]: """Returns a list of commands that have not been hidden.""" @@ -1590,7 +1590,7 @@ class Cmd(cmd.Cmd): def get_help_topics(self) -> List[str]: """ Returns a list of help topics """ return [name[5:] for name in self.get_names() - if name.startswith('help_') and isinstance(getattr(self, name), Callable)] + if name.startswith('help_') and callable(getattr(self, name))] def complete_help(self, text: str, line: str, begidx: int, endidx: int) -> List[str]: """ @@ -2895,13 +2895,13 @@ Paths or arguments that contain spaces must be enclosed in quotes if self.locals_in_py: def load_ipy(self, app): - banner = 'Entering an embedded IPython shell type quit() or <Ctrl>-d to exit ...' + banner = 'Entering an embedded IPython shell. Type quit() or <Ctrl>-d to exit ...' exit_msg = 'Leaving IPython, back to {}'.format(sys.argv[0]) embed(banner1=banner, exit_msg=exit_msg) load_ipy(self, bridge) else: def load_ipy(app): - banner = 'Entering an embedded IPython shell type quit() or <Ctrl>-d to exit ...' + banner = 'Entering an embedded IPython shell. Type quit() or <Ctrl>-d to exit ...' exit_msg = 'Leaving IPython, back to {}'.format(sys.argv[0]) embed(banner1=banner, exit_msg=exit_msg) load_ipy(bridge) @@ -3044,7 +3044,7 @@ a..b, a:b, a:, ..b items by indices (inclusive) # get the output out of the buffer output = membuf.read() # and add the regex-escaped output to the transcript - transcript += output.replace('/', '\/') + transcript += output.replace('/', r'\/') # Restore stdout to its original state self.stdout = saved_self_stdout |