diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-01-27 23:17:08 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-01-27 23:17:08 +0200 |
commit | fdf2bb0fecc52535539cbb4eae684c02249b6c81 (patch) | |
tree | 81dfa6f81478796dd0b5aad71bcc0309d87b462a | |
parent | c274e2940c2b0949f768fc914a4792d35682af9c (diff) | |
download | cliapp-fdf2bb0fecc52535539cbb4eae684c02249b6c81.tar.gz |
Drop empty lines, iterate over dict, not .keys()
-rw-r--r-- | cliapp/app.py | 4 | ||||
-rw-r--r-- | example.py | 1 | ||||
-rw-r--r-- | example2.py | 1 | ||||
-rw-r--r-- | example3.py | 1 | ||||
-rw-r--r-- | example4.py | 1 |
5 files changed, 2 insertions, 6 deletions
diff --git a/cliapp/app.py b/cliapp/app.py index 494d4b2..fe6a785 100644 --- a/cliapp/app.py +++ b/cliapp/app.py @@ -343,7 +343,7 @@ class Application(object): if self.subcommands: lines = [] prefix = 'Usage:' - for cmd in sorted(self.subcommands.keys()): + for cmd in sorted(self.subcommands): if all or cmd not in self.hidden_subcommands: args = self.cmd_synopsis.get(cmd, '') or '' lines.append( @@ -361,7 +361,7 @@ class Application(object): '''Format OptionParser description, with subcommand support.''' if self.subcommands: summaries = [] - for cmd in sorted(self.subcommands.keys()): + for cmd in sorted(self.subcommands): if show_all or cmd not in self.hidden_subcommands: summaries.append(self._format_subcommand_summary(cmd)) cmd_desc = ''.join(summaries) @@ -71,4 +71,3 @@ class ExampleApp(cliapp.Application): app = ExampleApp(version='0.1.2') app.settings.config_files = ['example.conf'] app.run() - diff --git a/example2.py b/example2.py index fcee592..90bf6b9 100644 --- a/example2.py +++ b/example2.py @@ -72,4 +72,3 @@ I hope you like it. ''') app.run() - diff --git a/example3.py b/example3.py index ea61ea2..e0965da 100644 --- a/example3.py +++ b/example3.py @@ -46,4 +46,3 @@ class ExampleApp(cliapp.Application): app = ExampleApp() app.run() - diff --git a/example4.py b/example4.py index c6ba78f..4baa35e 100644 --- a/example4.py +++ b/example4.py @@ -49,4 +49,3 @@ class ExampleApp(cliapp.Application): ExampleApp().run() - |