[GRASS-SVN] r61642 - grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 14 13:48:10 PDT 2014


Author: martinl
Date: 2014-08-14 13:48:10 -0700 (Thu, 14 Aug 2014)
New Revision: 61642

Modified:
   grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.py
Log:
wx.metadata: v.info.iso - use get_lib_path()

Modified: grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.py	2014-08-14 20:44:49 UTC (rev 61641)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.py	2014-08-14 20:48:10 UTC (rev 61642)
@@ -33,12 +33,21 @@
 
 import os
 import sys
-sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'etc', 'wx.metadata'))
 
-from grass.script import parser
-from mdgrass import *
+from grass.script import parser, fatal
+from grass.pygrass.functions import get_lib_path
 
+def load_mdlib():
+    path = get_lib_path(modname='wx.metadata', libname='mdgrass')
+    if path is not None:
+        fatal("Not able to find the metadata library directory")
+    sys.path.append(path)
+
 def main():
+    # load metadata library
+    load_mdlib()
+    from mdgrass import GrassMD
+
     if not options['output']:
         destination = None
         name = None



More information about the grass-commit mailing list