summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-04-18 11:18:54 +0300
committerLars Wirzenius <liw@liw.fi>2015-04-18 15:41:49 +0300
commita09e1064f58673591093df7f3b709a775c06b866 (patch)
tree173e13e3a3293e4a1871bb1fa2bb1ad3cd07d938 /example.py
parentd3b79bed48895150fb7c33f577716a900fda3833 (diff)
downloadcliapp-a09e1064f58673591093df7f3b709a775c06b866.tar.gz
Add running of pylint in 'make check' and fix things
Diffstat (limited to 'example.py')
-rw-r--r--example.py33
1 files changed, 21 insertions, 12 deletions
diff --git a/example.py b/example.py
index 14a56db..fe282be 100644
--- a/example.py
+++ b/example.py
@@ -31,16 +31,25 @@ class ExampleApp(cliapp.Application):
'''A little fgrep-like tool.'''
def add_settings(self):
- self.settings.string_list(['pattern', 'e'],
- 'search for regular expression PATTERN',
- metavar='REGEXP')
-
- self.settings.boolean(['dummy'], 'this setting is ignored',
- group='Test Group')
-
- self.settings.string(['yoyo'], 'yoyo', group=cliapp.config_group_name)
-
- self.settings.string(['nono'], 'nono', default=None)
+ self.settings.string_list(
+ ['pattern', 'e'],
+ 'search for regular expression PATTERN',
+ metavar='REGEXP')
+
+ self.settings.boolean(
+ ['dummy'],
+ 'this setting is ignored',
+ group='Test Group')
+
+ self.settings.string(
+ ['yoyo'],
+ 'yoyo',
+ group=cliapp.config_group_name)
+
+ self.settings.string(
+ ['nono'],
+ 'nono',
+ default=None)
# We override process_inputs to be able to do something after the last
# input line.
@@ -50,12 +59,12 @@ class ExampleApp(cliapp.Application):
self.output.write('There were %s matches.\n' % self.matches)
def process_input_line(self, name, line):
- logging.debug('processing %s:%s' % (name, self.lineno))
+ logging.debug('processing %s:%s', name, self.lineno)
for pattern in self.settings['pattern']:
if pattern in line:
self.output.write('%s:%s: %s' % (name, self.lineno, line))
self.matches += 1
- logging.debug('Match: %s line %d' % (name, self.lineno))
+ logging.debug('Match: %s line %d', name, self.lineno)
app = ExampleApp(version='0.1.2')