mirror of
https://github.com/samschott/maestral.git
synced 2024-10-06 18:37:20 +03:00
parent
51561a7270
commit
37bd403884
18
setup.py
18
setup.py
@ -14,13 +14,21 @@ def get_home_dir():
|
||||
try:
|
||||
path = osp.expanduser('~')
|
||||
except Exception:
|
||||
fallback = os.environ.get('TMP', '')
|
||||
fallback = os.environ.get('USERPROFILE', fallback)
|
||||
path = os.environ.get('HOME', fallback)
|
||||
path = ''
|
||||
|
||||
if osp.isdir(path):
|
||||
raise RuntimeError('Please set the environment variable HOME to your user/home'
|
||||
'directory.')
|
||||
return path
|
||||
else:
|
||||
for env_var in ('HOME', 'USERPROFILE', 'TMP'):
|
||||
path = os.environ.get(env_var, '')
|
||||
if osp.isdir(path):
|
||||
return path
|
||||
else:
|
||||
path = ''
|
||||
|
||||
if not path:
|
||||
raise RuntimeError('Please set the environment variable HOME to '
|
||||
'your user/home directory.')
|
||||
|
||||
|
||||
_home_dir = get_home_dir()
|
||||
|
Loading…
Reference in New Issue
Block a user