From d5343a4933475d935c53ca03c448884024973556 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 12 Mar 2011 12:39:41 +0000 Subject: Adapt to cliapp API changes. --- summain | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'summain') diff --git a/summain b/summain index c37e57c..7004882 100755 --- a/summain +++ b/summain @@ -25,8 +25,8 @@ import summainlib class Summain(cliapp.Application): def add_settings(self): - self.add_boolean_setting(['relative-paths', 'r'], - 'print paths relative to arguments') + self.settings.add_boolean_setting(['relative-paths', 'r'], + 'print paths relative to arguments') def files(self, root): if os.path.isdir(root): @@ -38,13 +38,13 @@ class Summain(cliapp.Application): yield root def process_args(self, args): - relative = self['relative-paths'] + relative = self.settings['relative-paths'] normalizer = summainlib.NumberNormalizer() for root in args: for filename in self.files(root): o = summainlib.FilesystemObject(filename, normalizer) - sys.stdout.write(o.format(root if relative else None)) - sys.stdout.write('\n') + self.output.write(o.format(root if relative else None)) + self.output.write('\n') Summain().run() -- cgit v1.2.1