diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-01-16 17:16:18 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-01-16 17:16:18 +0200 |
commit | b2d1c79a70fbe80b1f7ccb0275b032a124db7e49 (patch) | |
tree | 0844075976439ae91eaf5bce101a4c304d94b082 /example.py | |
parent | e438455f3debe973fc801ba0fde75c1c5f97e3d2 (diff) | |
download | cliapp-b2d1c79a70fbe80b1f7ccb0275b032a124db7e49.tar.gz |
Change example.py to use process_input_line instead of process_input.
Diffstat (limited to 'example.py')
-rw-r--r-- | example.py | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -25,12 +25,9 @@ class ExampleApp(cliapp.Application): self.parser.add_option('--pattern', '-e', action='store', help='the pattern to search for') - def process_input(self, name): - f = open(name, 'r') - for line in f: - if self.options.pattern in line: - print line, - f.close() + def process_input_line(self, name, line): + if self.options.pattern in line: + print line, ExampleApp().run() |