]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/scripts/cli.py
CLI: reconcile webopen changes
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / scripts / cli.py
index 7e0e5865c92e0db74234a15ac73f6ffbfdeaca27..98e489952c32adf6d50ba23fa61e6f2336a45eb1 100644 (file)
@@ -189,8 +189,11 @@ class LnOptions(VDriveOptions):
         return "%s ln FROM TO" % (os.path.basename(sys.argv[0]),)
 
 class WebopenOptions(VDriveOptions):
-    def parseArgs(self, vdrive_pathname=""):
-        self['vdrive_pathname'] = vdrive_pathname
+    def parseArgs(self, where=None):
+        self.where = where
+
+    def getSynopsis(self):
+        return "%s webopen [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
 
     longdesc = """Opens a webbrowser to the contents of some portion of the virtual drive."""
 
@@ -274,16 +277,9 @@ def ln(options):
     return rc
 
 def webopen(options, opener=None):
-    import urllib, webbrowser
-    nodeurl = config['node-url']
-    if nodeurl[-1] != "/":
-        nodeurl += "/"
-    root_cap = config.aliases["tahoe"]
-    url = nodeurl + "uri/%s/" % urllib.quote(root_cap)
-    if config['vdrive_pathname']:
-        url += urllib.quote(config['vdrive_pathname'])
-    webbrowser.open(url)
-    return 0
+    from allmydata.scripts import tahoe_webopen
+    rc = tahoe_webopen.webopen(options, opener=opener)
+    return rc
 
 dispatch = {
     "mkdir": mkdir,