summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2009-06-01 14:40:17 +0200
committerSebastian Hahn <sebastian@torproject.org>2009-08-25 19:49:22 +0200
commit8fcaaa5c88234a6141ec15610777d1b70910c97d (patch)
tree9cd04bfc3e16d297e517c03864e7c01f664d8704 /lib
parentb0c4e0fd4402b3e4d16e0c8112c68704e1937b87 (diff)
All current versions of Thandy have length fields
Diffstat (limited to 'lib')
-rw-r--r--lib/thandy/formats.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/thandy/formats.py b/lib/thandy/formats.py
index b8bdf5b..f59995a 100644
--- a/lib/thandy/formats.py
+++ b/lib/thandy/formats.py
@@ -438,7 +438,7 @@ BUNDLE_SCHEMA = S.Obj(
version=VERSION_SCHEMA,
path=RELPATH_SCHEMA,
hash=HASH_SCHEMA,
- length=S.Opt(LENGTH_SCHEMA),
+ length=LENGTH_SCHEMA,
order=S.Struct([S.Int(), S.Int(), S.Int()]),
optional=S.Opt(S.Bool()),
gloss=S.DictOf(S.AnyStr(), S.AnyStr()),
@@ -771,9 +771,7 @@ def makeBundleObj(config_fname, getPackage, getPackageLength):
raise thandy.FormatException("No such package as %s"%p['name'])
p['hash'] = formatHash(getDigest(pkginfo))
- length = getPackageLength(p['name'])
- if length != None:
- p['length'] = length
+ p['length'] = getPackageLength(p['name'])
if p['path'] == None:
p['path'] = pkginfo['location']
if p['version'] == None: