Unicode basedir changes for ticket798 branch.
This commit is contained in:
parent
013954c265
commit
d3a8ef762f
|
@ -1,7 +1,7 @@
|
||||||
import os.path, re, sys, fnmatch
|
import os.path, re, sys, fnmatch
|
||||||
from twisted.python import usage
|
from twisted.python import usage
|
||||||
from allmydata.scripts.common import BaseOptions, get_aliases
|
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]*))?")
|
NODEURL_RE=re.compile("http(s?)://([^:]*)(:([1-9][0-9]*))?")
|
||||||
|
|
||||||
|
@ -22,14 +22,13 @@ class VDriveOptions(BaseOptions, usage.Options):
|
||||||
]
|
]
|
||||||
|
|
||||||
def postOptions(self):
|
def postOptions(self):
|
||||||
# TODO: allow Unicode node-dir
|
|
||||||
# compute a node-url from the existing options, put in self['node-url']
|
# compute a node-url from the existing options, put in self['node-url']
|
||||||
if self['node-directory']:
|
if self['node-directory']:
|
||||||
if sys.platform == 'win32' and self['node-directory'] == '~/.tahoe':
|
if sys.platform == 'win32' and self['node-directory'] == '~/.tahoe':
|
||||||
from allmydata.windows import registry
|
from allmydata.windows import registry
|
||||||
self['node-directory'] = registry.get_base_dir_path()
|
self['node-directory'] = registry.get_base_dir_path()
|
||||||
else:
|
else:
|
||||||
self['node-directory'] = os.path.expanduser(self['node-directory'])
|
self['node-directory'] = argv_to_abspath(self['node-directory'])
|
||||||
if self['node-url']:
|
if self['node-url']:
|
||||||
if (not isinstance(self['node-url'], basestring)
|
if (not isinstance(self['node-url'], basestring)
|
||||||
or not NODEURL_RE.match(self['node-url'])):
|
or not NODEURL_RE.match(self['node-url'])):
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
import os, sys, urllib
|
import os, sys, urllib
|
||||||
import codecs
|
import codecs
|
||||||
from twisted.python import usage
|
from twisted.python import usage
|
||||||
from allmydata.util.encodingutil import unicode_to_url, quote_output
|
|
||||||
from allmydata.util.assertutil import precondition
|
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:
|
class BaseOptions:
|
||||||
# unit tests can override these to point at StringIO instances
|
# unit tests can override these to point at StringIO instances
|
||||||
|
|
Loading…
Reference in New Issue