]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Unicode basedir changes for ticket798 branch.
authordavid-sarah <david-sarah@jacaranda.org>
Sun, 1 Aug 2010 23:53:10 +0000 (16:53 -0700)
committerdavid-sarah <david-sarah@jacaranda.org>
Sun, 1 Aug 2010 23:53:10 +0000 (16:53 -0700)
src/allmydata/scripts/cli.py
src/allmydata/scripts/common.py

index 58a99f723e5f0b98a2e5d2ecaa4b57c7927c12a6..4150b877637bb5915e635db94f8bdeb9883e4442 100644 (file)
@@ -1,7 +1,7 @@
 import os.path, re, sys, fnmatch
 from twisted.python import usage
 from allmydata.scripts.common import BaseOptions, get_aliases
-from allmydata.util.encodingutil import argv_to_unicode
+from allmydata.util.encodingutil import argv_to_unicode, argv_to_abspath, quote_output
 
 NODEURL_RE=re.compile("http(s?)://([^:]*)(:([1-9][0-9]*))?")
 
@@ -22,14 +22,13 @@ class VDriveOptions(BaseOptions, usage.Options):
         ]
 
     def postOptions(self):
-        # TODO: allow Unicode node-dir
         # compute a node-url from the existing options, put in self['node-url']
         if 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'])
+                self['node-directory'] = argv_to_abspath(self['node-directory'])
         if self['node-url']:
             if (not isinstance(self['node-url'], basestring)
                 or not NODEURL_RE.match(self['node-url'])):
index 88fdd286f8f0633bef498e790ff576b00be98752..a76d0a34e82954a598671d80693d53be5e4b711c 100644 (file)
@@ -2,8 +2,9 @@
 import os, sys, urllib
 import codecs
 from twisted.python import usage
-from allmydata.util.encodingutil import unicode_to_url, quote_output
 from allmydata.util.assertutil import precondition
+from allmydata.util.encodingutil import unicode_to_url, quote_output, argv_to_abspath
+from allmydata.util.fileutil import abspath_expanduser_unicode
 
 class BaseOptions:
     # unit tests can override these to point at StringIO instances