[GRASS-SVN] r61638 - grass-addons/grass7/gui/wxpython/wx.metadata/mdlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Aug 14 12:10:24 PDT 2014
Author: krejcmat
Date: 2014-08-14 12:10:24 -0700 (Thu, 14 Aug 2014)
New Revision: 61638
Modified:
grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py
Log:
path fix
Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py 2014-08-14 18:37:36 UTC (rev 61637)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py 2014-08-14 19:10:24 UTC (rev 61638)
@@ -63,7 +63,8 @@
# metadata object from OWSLIB ( for define md values)
self.md = MD_Metadata(md=None)
self.template = None # path to file with xml templates
-
+ self.addonsPath=os.path.join(os.getenv('GRASS_ADDON_BASE'), 'etc', 'wx.metadata')
+
if self.type == "cell":
self.parseRast()
elif self.type == "vector":
@@ -88,21 +89,21 @@
# parse md from v.info flags=-g -e -t
vinfo = Module(
- 'v.info',
- self.map,
- flags='get',
- quiet=True,
- stdout_=PIPE)
+ 'v.info',
+ self.map,
+ flags='get',
+ quiet=True,
+ stdout_=PIPE)
self.md_grass = parse_key_val(vinfo.outputs.stdout)
# parse md from v.info flag=h (history of map in grass)
rinfo_h = Module(
- 'v.info',
- self.map,
- flags='h',
- quiet=True,
- stdout_=PIPE)
+ 'v.info',
+ self.map,
+ flags='h',
+ quiet=True,
+ stdout_=PIPE)
md_h_grass = rinfo_h.outputs.stdout
buf = StringIO.StringIO(md_h_grass)
@@ -130,8 +131,8 @@
def parseRast(self):
'''Read metadata from r.info
- #self.md_grass dictionary of metadata from v.info
- #self.md_abstract string created by merge information from 'description' and 'source'
+ @var self.md_grass dictionary of metadata from v.info
+ @var self.md_abstract string created by merge information from 'description' and 'source'
'''
rinfo = Module('r.info',
self.map,
@@ -168,7 +169,8 @@
n = '$NULL'
# jinja templates
if template is None:
- parentDir=os.path.abspath(os.path.join(self.dirpath, os.path.pardir))
+
+ parentDir=os.path.abspath(os.path.join(self.addonsPath, os.path.pardir))
self.template = os.path.join(parentDir,'templates', 'basicTemplate.xml')
else:
self.template = template
@@ -263,7 +265,6 @@
def createGrassInspireISO(self, template=None):
'''Create valid INSPIRE profile and fill it as much as possible by GRASS metadata. Missing values is $NULL
- -create basic md profile and add INSPIRE mandatory attributes
'''
self.schema_type = '_inspire.xml'
@@ -272,7 +273,7 @@
self.createGrassBasicISO()
if template is None:
- parentDir=os.path.abspath(os.path.join(self.dirpath, os.path.pardir))
+ parentDir=os.path.abspath(os.path.join(self.addonsPath, os.path.pardir))
self.template = os.path.join(parentDir,'templates', 'inspireTemplate.xml')
else:
self.template = template
More information about the grass-commit
mailing list