From: david-sarah Date: Sun, 1 Aug 2010 23:53:10 +0000 (-0700) Subject: Unicode basedir changes for ticket798 branch. X-Git-Url: https://git.rkrishnan.org/pf//%22%22.?a=commitdiff_plain;h=d3a8ef762f74b925766055d07f5a161547a0052c;p=tahoe-lafs%2Ftahoe-lafs.git Unicode basedir changes for ticket798 branch. --- diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py index 58a99f72..4150b877 100644 --- a/src/allmydata/scripts/cli.py +++ b/src/allmydata/scripts/cli.py @@ -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'])): diff --git a/src/allmydata/scripts/common.py b/src/allmydata/scripts/common.py index 88fdd286..a76d0a34 100644 --- a/src/allmydata/scripts/common.py +++ b/src/allmydata/scripts/common.py @@ -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