change default node-directory on windows to do registry lookup, not ~/.tahoe

This commit is contained in:
robk-tahoe 2008-01-10 19:32:18 -07:00
parent fbf6c48ed8
commit 0b097ac485
2 changed files with 10 additions and 2 deletions

View File

@ -27,7 +27,11 @@ class VDriveOptions(BaseOptions, usage.Options):
def postOptions(self):
# compute a node-url from the existing options, put in self['node-url']
if self['node-directory']:
self['node-directory'] = os.path.expanduser(self['node-directory'])
if sys.platform == 'win32' and self['node-directory'] == '~/.tahoe':
from allmydata.windows import registry
self['node-directory'] = registry.get_base_dir_path()
else:
self['node-directory'] = os.path.expanduser(self['node-directory'])
if self['node-url']:
if (not isinstance(self['node-url'], basestring)
or not NODEURL_RE.match(self['node-url'])):

View File

@ -36,7 +36,11 @@ class BasedirMixin:
self.basedirs.extend(args)
else:
if len(args) == 0 and not self.basedirs:
self.basedirs.append(os.path.expanduser("~/.tahoe"))
if sys.platform == 'win32':
from allmydata.windows import registry
self.basedirs.append(registry.get_base_dir_path())
else:
self.basedirs.append(os.path.expanduser("~/.tahoe"))
if len(args) > 0:
self.basedirs.append(args[0])
if len(args) > 1: