summaryrefslogtreecommitdiff
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
parent795018f2237addf0548ef420a8416ba730372550 (diff)
downloadsummain-d5343a4933475d935c53ca03c448884024973556.tar.gz
Adapt to cliapp API changes.
-rw-r--r--debian/control5
-rwxr-xr-xsummain10
2 files changed, 8 insertions, 7 deletions
diff --git a/debian/control b/debian/control
index 90f1a91..e32a787 100644
--- a/debian/control
+++ b/debian/control
@@ -4,12 +4,13 @@ Section: misc
Priority: optional
Standards-Version: 3.8.3
Build-Depends: debhelper (>= 7.3.8), python-support (>= 1.0.3),
- python (>= 2.5), extrautils, python-cliapp
+ python (>= 2.5), extrautils, python-cliapp (>= 0.7)
Homepage: http://liw.fi/summain/
Package: summain
Architecture: all
-Depends: ${python:Depends}, ${misc:Depends}, python (>= 2.5), python-cliapp
+Depends: ${python:Depends}, ${misc:Depends}, python (>= 2.5),
+ python-cliapp (>= 0.7)
Description: create file manifests with checksums
Summain generates file manifests, which contain metadata about the files,
and a checksum of their content for regular files. The manifest can be
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()