summaryrefslogtreecommitdiff
path: root/summain
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-03-12 12:39:41 +0000
committerLars Wirzenius <liw@liw.fi>2011-03-12 12:39:41 +0000
commitd5343a4933475d935c53ca03c448884024973556 (patch)
tree51f70aa78f6f79e66c86ce7348899198d8a47f0b /summain
parent795018f2237addf0548ef420a8416ba730372550 (diff)
downloadsummain-d5343a4933475d935c53ca03c448884024973556.tar.gz
Adapt to cliapp API changes.
Diffstat (limited to 'summain')
-rwxr-xr-xsummain10
1 files changed, 5 insertions, 5 deletions
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()