Thu Jul 22 04:51:05 GMT Daylight Time 2010 david-sarah@jacaranda.org * web.filenode: include the current (rather than cached) file size in the JSON metadata for a mutable file. fixes #677 New patches: [web.filenode: include the current (rather than cached) file size in the JSON metadata for a mutable file. fixes #677 david-sarah@jacaranda.org**20100722035105 Ignore-this: 217289ca072bbf111c5367d6e0d963a2 ] hunk ./src/allmydata/web/filenode.py 471 def FileJSONMetadata(ctx, filenode, edge_metadata): - rw_uri = filenode.get_write_uri() - ro_uri = filenode.get_readonly_uri() - data = ("filenode", {}) - data[1]['size'] = filenode.get_size() - if ro_uri: - data[1]['ro_uri'] = ro_uri - if rw_uri: - data[1]['rw_uri'] = rw_uri - verifycap = filenode.get_verify_cap() - if verifycap: - data[1]['verify_uri'] = verifycap.to_string() - data[1]['mutable'] = filenode.is_mutable() - if edge_metadata is not None: - data[1]['metadata'] = edge_metadata - return text_plain(simplejson.dumps(data, indent=1) + "\n", ctx) + d = filenode.get_current_size() + def _got_size(size): + data = ("filenode", {}) + data[1]['size'] = size + rw_uri = filenode.get_write_uri() + ro_uri = filenode.get_readonly_uri() + if ro_uri: + data[1]['ro_uri'] = ro_uri + if rw_uri: + data[1]['rw_uri'] = rw_uri + verifycap = filenode.get_verify_cap() + if verifycap: + data[1]['verify_uri'] = verifycap.to_string() + data[1]['mutable'] = filenode.is_mutable() + if edge_metadata is not None: + data[1]['metadata'] = edge_metadata + return text_plain(simplejson.dumps(data, indent=1) + "\n", ctx) + d.addCallback(_got_size) + return d def FileURI(ctx, filenode): return text_plain(filenode.get_uri(), ctx) Context: [__init__.py: silence DeprecationWarning about BaseException.message globally. fixes #1129 david-sarah@jacaranda.org**20100720011939 Ignore-this: 38808986ba79cb2786b010504a22f89 ] [test_runner: test that 'tahoe --version' outputs no noise (e.g. DeprecationWarnings). david-sarah@jacaranda.org**20100720011345 Ignore-this: dd358b7b2e5d57282cbe133e8069702e ] [TAG allmydata-tahoe-1.7.1 zooko@zooko.com**20100719131352 Ignore-this: 6942056548433dc653a746703819ad8c ] Patch bundle hash: 37435205139403a8ba71c719b335711f0dcd7244