From: Brian Warner Date: Fri, 15 Jun 2007 09:31:23 +0000 (-0700) Subject: webish: add option to export/import shared directories (always read-write) X-Git-Tag: allmydata-tahoe-0.4.0~36 X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/provisioning?a=commitdiff_plain;h=2066e8ddfcb3fb7c4f4d5a8fbd1591e249cc058b;p=tahoe-lafs%2Ftahoe-lafs.git webish: add option to export/import shared directories (always read-write) --- diff --git a/src/allmydata/web/directory.xhtml b/src/allmydata/web/directory.xhtml index 430223cd..03f26d8d 100644 --- a/src/allmydata/web/directory.xhtml +++ b/src/allmydata/web/directory.xhtml @@ -13,6 +13,9 @@
Refresh this view
Parent Directory
+
To share this directory, paste the following FURL string into an + "Add Shared Directory" box: +
diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index 9671ef6b..618c34b0 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -136,6 +136,9 @@ class Directory(rend.Page): def render_header(self, ctx, data): return "Directory of '%s':" % self._dirname + def data_share_url(self, ctx, data): + return self._dirnode.furl + def data_children(self, ctx, data): d = self._dirnode.list() return d @@ -265,6 +268,21 @@ class Directory(rend.Page): d.addCallback(_done) return d + def bind_mount(self, ctx): + namearg = annotate.Argument("name", + annotate.String("Name to place incoming directory: ")) + furlarg = annotate.Argument("furl", + annotate.String("FURL of Shared Directory")) + meth = annotate.Method(arguments=[namearg, furlarg], + label="Add Shared Directory") + return annotate.MethodBinding("mount", meth, + action="Mount Shared Directory") + + def mount(self, name, furl): + d = self._dirnode.attach_shared_directory(name, furl) + d.addCallback(lambda done: url.here.child(name)) + return d + def child__delete(self, ctx): # perform the delete, then redirect back to the directory page args = inevow.IRequest(ctx).args