From fdf2bb0fecc52535539cbb4eae684c02249b6c81 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 27 Jan 2017 23:17:08 +0200 Subject: Drop empty lines, iterate over dict, not .keys() --- cliapp/app.py | 4 ++-- example.py | 1 - example2.py | 1 - example3.py | 1 - 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) diff --git a/example.py b/example.py index 3eaf996..f49645d 100644 --- a/example.py +++ b/example.py @@ -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() - -- cgit v1.2.1