summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-01-27 23:17:08 +0200
committerLars Wirzenius <liw@liw.fi>2017-01-27 23:17:08 +0200
commitfdf2bb0fecc52535539cbb4eae684c02249b6c81 (patch)
tree81dfa6f81478796dd0b5aad71bcc0309d87b462a
parentc274e2940c2b0949f768fc914a4792d35682af9c (diff)
downloadcliapp-fdf2bb0fecc52535539cbb4eae684c02249b6c81.tar.gz
Drop empty lines, iterate over dict, not .keys()
-rw-r--r--cliapp/app.py4
-rw-r--r--example.py1
-rw-r--r--example2.py1
-rw-r--r--example3.py1
-rw-r--r--example4.py1
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()
-