1 | Fri Aug 7 18:25:42 PDT 2009 Kevan Carstensen <kevan@isnotajoke.com> |
---|
2 | * Fix a logic error in `tahoe_ls.py' |
---|
3 | |
---|
4 | Fri Aug 7 18:27:42 PDT 2009 Kevan Carstensen <kevan@isnotajoke.com> |
---|
5 | * Fix misbehavior in `filenode.py' |
---|
6 | |
---|
7 | Per the spec, if you GET a dircap with a path to a file and specify that you want json, you should get metadata back. This wasn't happening before. |
---|
8 | |
---|
9 | New patches: |
---|
10 | |
---|
11 | [Fix a logic error in `tahoe_ls.py' |
---|
12 | Kevan Carstensen <kevan@isnotajoke.com>**20090808012542 |
---|
13 | Ignore-this: 88d54458521e76ca039b4294ade53dcc |
---|
14 | ] hunk ./src/allmydata/scripts/tahoe_ls.py 55 |
---|
15 | children = d['children'] |
---|
16 | elif nodetype == "filenode": |
---|
17 | childname = path.split("/")[-1] |
---|
18 | - children = {childname: d} |
---|
19 | + children = {childname: [nodetype, d]} |
---|
20 | childnames = sorted(children.keys()) |
---|
21 | now = time.time() |
---|
22 | |
---|
23 | [Fix misbehavior in `filenode.py' |
---|
24 | Kevan Carstensen <kevan@isnotajoke.com>**20090808012742 |
---|
25 | Ignore-this: ae04a444be086f67b5e82243f12da6ac |
---|
26 | |
---|
27 | Per the spec, if you GET a dircap with a path to a file and specify that you want json, you should get metadata back. This wasn't happening before. |
---|
28 | ] { |
---|
29 | hunk ./src/allmydata/web/filenode.py 9 |
---|
30 | from nevow import url, rend |
---|
31 | from nevow.inevow import IRequest |
---|
32 | |
---|
33 | -from allmydata.interfaces import ExistingChildError, CannotPackUnknownNodeError |
---|
34 | +from allmydata.interfaces import ExistingChildError, \ |
---|
35 | + CannotPackUnknownNodeError, IDirectoryNode |
---|
36 | from allmydata.monitor import Monitor |
---|
37 | from allmydata.immutable.upload import FileHandle |
---|
38 | from allmydata.immutable.filenode import LiteralFileNode |
---|
39 | hunk ./src/allmydata/web/filenode.py 191 |
---|
40 | d.addCallback(lambda dn: FileDownloader(dn, filename)) |
---|
41 | return d |
---|
42 | if t == "json": |
---|
43 | - return FileJSONMetadata(ctx, self.node) |
---|
44 | + return FileJSONMetadata(ctx, self.node, self.parentnode, self.name) |
---|
45 | if t == "info": |
---|
46 | return MoreInfo(self.node) |
---|
47 | if t == "uri": |
---|
48 | hunk ./src/allmydata/web/filenode.py 423 |
---|
49 | return req.deferred |
---|
50 | |
---|
51 | |
---|
52 | -def FileJSONMetadata(ctx, filenode): |
---|
53 | +def FileJSONMetadata(ctx, filenode, parentnode=None, name=None): |
---|
54 | if filenode.is_readonly(): |
---|
55 | rw_uri = None |
---|
56 | ro_uri = filenode.get_uri() |
---|
57 | hunk ./src/allmydata/web/filenode.py 440 |
---|
58 | if verifycap: |
---|
59 | data[1]['verify_uri'] = verifycap.to_string() |
---|
60 | data[1]['mutable'] = filenode.is_mutable() |
---|
61 | - return text_plain(simplejson.dumps(data, indent=1) + "\n", ctx) |
---|
62 | + if parentnode and name: |
---|
63 | + assert(IDirectoryNode.providedBy(parentnode)) |
---|
64 | + d = parentnode.get_metadata_for(name) |
---|
65 | + def _handle_metadata(metadata): |
---|
66 | + data[1]["metadata"] = metadata |
---|
67 | + return text_plain(simplejson.dumps(data, indent=1) + "\n", ctx) |
---|
68 | + d.addCallback(_handle_metadata) |
---|
69 | + return d |
---|
70 | + else: |
---|
71 | + return text_plain(simplejson.dumps(data, indent=1) + "\n", ctx) |
---|
72 | |
---|
73 | def FileURI(ctx, filenode): |
---|
74 | return text_plain(filenode.get_uri(), ctx) |
---|
75 | } |
---|
76 | |
---|
77 | Context: |
---|
78 | |
---|
79 | [docs: install.html: instruct Debian users to use this document and not to go find the DownloadDebianPackages page, ignore the warning at the top of it, and try it |
---|
80 | zooko@zooko.com**20090804123840 |
---|
81 | Ignore-this: 49da654f19d377ffc5a1eff0c820e026 |
---|
82 | http://allmydata.org/pipermail/tahoe-dev/2009-August/002507.html |
---|
83 | ] |
---|
84 | [docs: relnotes.txt: reflow to 63 chars wide because google groups and some web forms seem to wrap to that |
---|
85 | zooko@zooko.com**20090802135016 |
---|
86 | Ignore-this: 53b1493a0491bc30fb2935fad283caeb |
---|
87 | ] |
---|
88 | [docs: about.html: fix English usage noticed by Amber |
---|
89 | zooko@zooko.com**20090802050533 |
---|
90 | Ignore-this: 89965c4650f9bd100a615c401181a956 |
---|
91 | ] |
---|
92 | [docs: fix mis-spelled word in about.html |
---|
93 | zooko@zooko.com**20090802050320 |
---|
94 | Ignore-this: fdfd0397bc7cef9edfde425dddeb67e5 |
---|
95 | ] |
---|
96 | [TAG allmydata-tahoe-1.5.0 |
---|
97 | zooko@zooko.com**20090802031303 |
---|
98 | Ignore-this: 94e5558e7225c39a86aae666ea00f166 |
---|
99 | ] |
---|
100 | Patch bundle hash: |
---|
101 | 06ca1ee1a686c75c55b27fd7558a54c70010bb99 |
---|