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]*))?")
]
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'])):
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