4
PURPOSE: GRASS environment variable management
6
AUTHORS: The GRASS Development Team
7
Jachym Cepicky (Mendel University of Agriculture)
8
Martin Landa <landa.martin gmail.com>
10
COPYRIGHT: (C) 2006-2007 by the GRASS Development Team
11
This program is free software under the GNU General Public
12
License (>=v2). Read the file COPYING that comes with GRASS
25
CompatPath = os.path.join(globalvar.ETCWXDIR, "compat")
26
sys.path.append(CompatPath)
31
def GetGRASSVariable(var):
32
"""Return GRASS variable or '' if variable is not defined"""
33
# gisEnv = gcmd.Command(['g.gisenv'])
35
gisEnv = subprocess.Popen(['g.gisenv' + globalvar.EXT_BIN],
37
stdout=subprocess.PIPE,
40
for item in gisEnv.stdout.readlines():
42
return item.split('=')[1].replace("'",'').replace(';','').strip()