2015-05-26 15:06:06 +00:00
|
|
|
|
|
|
|
import sys
|
2020-08-21 20:27:21 +00:00
|
|
|
import six
|
2015-05-26 15:06:06 +00:00
|
|
|
from allmydata.util.assertutil import precondition
|
|
|
|
from allmydata.util.fileutil import abspath_expanduser_unicode
|
|
|
|
|
2020-08-21 20:27:21 +00:00
|
|
|
|
2015-05-26 15:06:06 +00:00
|
|
|
_default_nodedir = None
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
from allmydata.windows import registry
|
|
|
|
path = registry.get_base_dir_path()
|
|
|
|
if path:
|
2020-08-21 20:27:21 +00:00
|
|
|
precondition(isinstance(path, six.text_type), path)
|
2015-05-26 15:06:06 +00:00
|
|
|
_default_nodedir = abspath_expanduser_unicode(path)
|
|
|
|
|
|
|
|
if _default_nodedir is None:
|
|
|
|
path = abspath_expanduser_unicode(u"~/.tahoe")
|
2020-08-21 20:27:21 +00:00
|
|
|
precondition(isinstance(path, six.text_type), path)
|
2015-05-26 15:06:06 +00:00
|
|
|
_default_nodedir = path
|