7258: Replace some os.environ['foo'] lookups missed earlier.
This commit is contained in:
parent
2a81c76e69
commit
71650917bf
@ -93,7 +93,7 @@ if 'GRAMPSHOME' in os.environ:
|
|||||||
elif 'USERPROFILE' in os.environ:
|
elif 'USERPROFILE' in os.environ:
|
||||||
USER_HOME = get_env_var('USERPROFILE')
|
USER_HOME = get_env_var('USERPROFILE')
|
||||||
if 'APPDATA' in os.environ:
|
if 'APPDATA' in os.environ:
|
||||||
HOME_DIR = os.path.join(os.environ['APPDATA'], 'gramps')
|
HOME_DIR = os.path.join(get_env_var('APPDATA'), 'gramps')
|
||||||
else:
|
else:
|
||||||
HOME_DIR = os.path.join(USER_HOME, 'gramps')
|
HOME_DIR = os.path.join(USER_HOME, 'gramps')
|
||||||
else:
|
else:
|
||||||
|
@ -2464,10 +2464,9 @@ def write_lock_file(name):
|
|||||||
os.mkdir(name)
|
os.mkdir(name)
|
||||||
f = open(os.path.join(name, DBLOCKFN), "w")
|
f = open(os.path.join(name, DBLOCKFN), "w")
|
||||||
if win():
|
if win():
|
||||||
user = os.environ['USERNAME']
|
user = get_env_var('USERNAME')
|
||||||
try:
|
host = get_env_var('USERDOMAIN')
|
||||||
host = os.environ['USERDOMAIN']
|
if host == None:
|
||||||
except:
|
|
||||||
host = ""
|
host = ""
|
||||||
else:
|
else:
|
||||||
host = os.uname()[1]
|
host = os.uname()[1]
|
||||||
|
@ -44,7 +44,7 @@ LOG = logging.getLogger(".gen.utils.file")
|
|||||||
# Gramps modules
|
# Gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from ..constfunc import win, mac, cuni, conv_to_unicode, UNITYPE
|
from ..constfunc import win, mac, cuni, conv_to_unicode, UNITYPE, get_env_var
|
||||||
from ..const import TEMP_DIR, USER_HOME, GRAMPS_LOCALE as glocale
|
from ..const import TEMP_DIR, USER_HOME, GRAMPS_LOCALE as glocale
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -266,14 +266,14 @@ def search_for(name):
|
|||||||
else:
|
else:
|
||||||
name = name.split()[0]
|
name = name.split()[0]
|
||||||
if win():
|
if win():
|
||||||
for i in os.environ['PATH'].split(';'):
|
for i in get_env_var('PATH').split(';'):
|
||||||
fname = os.path.join(i, name)
|
fname = os.path.join(i, name)
|
||||||
if os.access(fname, os.X_OK) and not os.path.isdir(fname):
|
if os.access(fname, os.X_OK) and not os.path.isdir(fname):
|
||||||
return 1
|
return 1
|
||||||
if os.access(name, os.X_OK) and not os.path.isdir(name):
|
if os.access(name, os.X_OK) and not os.path.isdir(name):
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
for i in os.environ['PATH'].split(':'):
|
for i in os.environ['PATH'].split(':'): #not win()
|
||||||
fname = os.path.join(i, name)
|
fname = os.path.join(i, name)
|
||||||
if os.access(fname, os.X_OK) and not os.path.isdir(fname):
|
if os.access(fname, os.X_OK) and not os.path.isdir(fname):
|
||||||
return 1
|
return 1
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
# Need to be able to import Gramps files from here.
|
# Need to be able to import Gramps files from here.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
if os.environ.get('GRAMPS_RESOURCES', None) is None:
|
if not 'GRAMPS_RESOURCES' in os.environ:
|
||||||
os.environ['GRAMPS_RESOURCES'] = os.path.dirname(os.path.abspath("../.."))
|
os.environ['GRAMPS_RESOURCES'] = os.path.dirname(os.path.abspath("../.."))
|
||||||
|
|
||||||
from gramps.gen.const import DATA_DIR, WEB_DIR
|
from gramps.gen.const import DATA_DIR, WEB_DIR
|
||||||
|
Loading…
x
Reference in New Issue
Block a user