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."""
+ longdesc = """Opens a webbrowser to the contents of some portion of the virtual drive. When called without arguments, opens to the Welcome page."""
class ManifestOptions(VDriveOptions):
optFlags = [
if not nodeurl.endswith("/"):
nodeurl += "/"
where = options.where
- rootcap, path = get_alias(options.aliases, where, DEFAULT_ALIAS)
- if path == '/':
- path = ''
- url = nodeurl + "uri/%s" % urllib.quote(rootcap)
- if path:
- url += "/" + escape_path(path)
+ if where:
+ rootcap, path = get_alias(options.aliases, where, DEFAULT_ALIAS)
+ if path == '/':
+ path = ''
+ url = nodeurl + "uri/%s" % urllib.quote(rootcap)
+ if path:
+ url += "/" + escape_path(path)
+ else:
+ url = nodeurl
if not opener:
import webbrowser
opener = webbrowser.open
aliases = get_aliases(self.get_clientdir())
node_url_file = os.path.join(self.get_clientdir(), "node.url")
nodeurl = open(node_url_file, "r").read().strip()
+ self.welcome_url = nodeurl
uribase = nodeurl + "uri/"
self.tahoe_url = uribase + urllib.quote(aliases["tahoe"])
self.tahoe_subdir_url = self.tahoe_url + "/subdir"
d.addCallback(_check_add_duplicate)
def _test_urls(junk):
- self._test_webopen([], self.tahoe_url)
+ self._test_webopen([], self.welcome_url)
self._test_webopen(["/"], self.tahoe_url)
self._test_webopen(["tahoe:"], self.tahoe_url)
self._test_webopen(["tahoe:/"], self.tahoe_url)