]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
change default node-directory on windows to do registry lookup, not ~/.tahoe
authorrobk-tahoe <robk-tahoe@allmydata.com>
Fri, 11 Jan 2008 02:32:18 +0000 (19:32 -0700)
committerrobk-tahoe <robk-tahoe@allmydata.com>
Fri, 11 Jan 2008 02:32:18 +0000 (19:32 -0700)
src/allmydata/scripts/cli.py
src/allmydata/scripts/common.py

index c8d01eff0aebef663dc92a465eea87ad7d11d5f7..c03b88cdbfaddbdb71de323adb525d88ed7cb782 100644 (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'])):
index dd15fda8d5cbedca6fe02d84fbf125af8519a24e..6391a91b3927320fe9cd2360a7b3810f6342c7e9 100644 (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: