diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-04-18 11:18:54 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-04-18 15:41:49 +0300 |
commit | a09e1064f58673591093df7f3b709a775c06b866 (patch) | |
tree | 173e13e3a3293e4a1871bb1fa2bb1ad3cd07d938 /example.py | |
parent | d3b79bed48895150fb7c33f577716a900fda3833 (diff) | |
download | cliapp-a09e1064f58673591093df7f3b709a775c06b866.tar.gz |
Add running of pylint in 'make check' and fix things
Diffstat (limited to 'example.py')
-rw-r--r-- | example.py | 33 |
1 files changed, 21 insertions, 12 deletions
@@ -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') |