[GRASS-SVN] r66408 - in grass-addons/grass7/gui/wxpython/wx.metadata: db.csw.admin g.gui.cswbrowser g.gui.metadata mdlib r.info.iso t.info.iso v.info.iso

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 4 04:56:04 PDT 2015


Author: martinl
Date: 2015-10-04 04:56:04 -0700 (Sun, 04 Oct 2015)
New Revision: 66408

Modified:
   grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.admin/db.csw.admin.py
   grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.py
   grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.py
   grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py
   grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdpdffactory.py
   grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.py
   grass-addons/grass7/gui/wxpython/wx.metadata/t.info.iso/t.info.iso.py
   grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.py
Log:
wx.metadata: use set_path() instead of get_lib_path()

Modified: grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.admin/db.csw.admin.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.admin/db.csw.admin.py	2015-10-04 10:45:59 UTC (rev 66407)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/db.csw.admin/db.csw.admin.py	2015-10-04 11:56:04 UTC (rev 66408)
@@ -119,13 +119,9 @@
 import ConfigParser
 
 from grass.script import core as grass
-from grass.pygrass.utils import get_lib_path
+from grass.pygrass.utils import set_path
 
-path = get_lib_path(modname='wx.metadata', libname='mdlib')
-if path is not None and path not in sys.path:
-    sys.path.append(path)
-elif path is  None:
-    grass.fatal("Fatal error: library < %s > not found " % 'mdlib')
+set_path(modulename='wx.metadata', dirname='mdlib')
 
 import getopt
 from cswutil import *

Modified: grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.py	2015-10-04 10:45:59 UTC (rev 66407)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.cswbrowser/g.gui.cswbrowser.py	2015-10-04 11:56:04 UTC (rev 66408)
@@ -13,14 +13,10 @@
 import sys
 import os
 
-from grass.pygrass.utils import get_lib_path
+from grass.pygrass.utils import set_path
 import grass.script as grass
 
-path = get_lib_path(modname='wx.metadata', libname='mdlib')
-if path is not None and path not in sys.path:
-    sys.path.append(path)
-elif path is  None:
-    grass.fatal("Fatal error: library < %s > not found " % 'mdlib')
+set_path(modulename='wx.metadata', dirname='mdlib')
 
 import wx
 from cswlib import CSWBrowserPanel, CSWConnectionPanel

Modified: grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.py	2015-10-04 10:45:59 UTC (rev 66407)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.py	2015-10-04 11:56:04 UTC (rev 66408)
@@ -23,18 +23,14 @@
 
 import sys
 import os
-from grass.pygrass.utils import get_lib_path
+from grass.pygrass.utils import set_path
 import grass.script as grass
 from grass.pydispatch import dispatcher
 from core.gcmd import RunCommand, GError, GMessage
 import grass.temporal as tgis
 from datacatalog.tree import LocationMapTree
 
-path = get_lib_path(modname='wx.metadata', libname='mdlib')
-if path is not None and path not in sys.path:
-    sys.path.append(path)
-elif path is  None:
-    grass.fatal("Fatal error: library < %s > not found " % 'mdlib')
+set_path(modulename='wx.metadata', dirname='mdlib')
 
 import mdgrass
 import mdutil

Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py	2015-10-04 10:45:59 UTC (rev 66407)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdgrass.py	2015-10-04 11:56:04 UTC (rev 66408)
@@ -26,13 +26,9 @@
     sys.exit('jinja2 library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
 
 from grass.script import core as grass
-from grass.pygrass.utils import get_lib_path
+from grass.pygrass.utils import set_path
 
-path = get_lib_path(modname='wx.metadata', libname='mdlib')
-if path is not None and path not in sys.path:
-    sys.path.append(path)
-elif path is  None:
-    grass.fatal("Fatal error: library < %s > not found " % 'mdlib')
+set_path(modulename='wx.metadata', dirname='mdlib')
 
 from lxml import etree
 import StringIO

Modified: grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdpdffactory.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdpdffactory.py	2015-10-04 10:45:59 UTC (rev 66407)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/mdlib/mdpdffactory.py	2015-10-04 11:56:04 UTC (rev 66408)
@@ -3,14 +3,10 @@
 except:
     sys.exit('owslib library is missing. Check requirements on the manual page < https://grasswiki.osgeo.org/wiki/ISO/INSPIRE_Metadata_Support >')
 import tempfile, sys, os
-from grass.pygrass.utils import get_lib_path
+from grass.pygrass.utils import set_path
 from grass.script import core as grass
 
-path = get_lib_path(modname='wx.metadata', libname='mdlib')
-if path is not None and path not in sys.path:
-    sys.path.append(path)
-elif path is  None:
-    grass.fatal("Fatal error: library < %s > not found " % 'mdlib')
+set_path(modulename='wx.metadata', dirname='mdlib')
 
 import math
 from reportlab.platypus import Paragraph, Image, Table

Modified: grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.py	2015-10-04 10:45:59 UTC (rev 66407)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/r.info.iso/r.info.iso.py	2015-10-04 11:56:04 UTC (rev 66408)
@@ -38,21 +38,12 @@
 import sys
 
 from grass.script import parser, fatal
-from grass.pygrass.utils import get_lib_path
+from grass.pygrass.utils import set_path
 
+set_path(modulename='wx.metadata', dirname='mdlib')
 
-def load_mdlib(libs):
-    for lib in libs:
-        path = get_lib_path(modname='wx.metadata', libname=lib)
-        if path is not None and path not in sys.path:
-            sys.path.append(path)
-        elif path is  None:
-            fatal("Fatal error: library < %s > not found "%lib)
-
-
 def main():
     # load metadata library
-    load_mdlib(['mdlib'])
     from mdgrass import GrassMD
 
     if not options['output']:

Modified: grass-addons/grass7/gui/wxpython/wx.metadata/t.info.iso/t.info.iso.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.metadata/t.info.iso/t.info.iso.py	2015-10-04 10:45:59 UTC (rev 66407)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/t.info.iso/t.info.iso.py	2015-10-04 11:56:04 UTC (rev 66408)
@@ -38,21 +38,12 @@
 import grass.temporal as tgis
 import grass.script as grass
 from grass.script import parser, fatal
-from grass.pygrass.utils import get_lib_path
+from grass.pygrass.utils import set_path
 
+set_path(modulename='wx.metadata', dirname='mdlib')
 
-def load_mdlib(libs):
-    for lib in libs:
-        path = get_lib_path(modname='wx.metadata' ,libname=lib)
-        if path is not None and path not in sys.path:
-            sys.path.append(path)
-        elif path is  None:
-            fatal("Fatal error: library < %s > not found "%lib)
-
-
 def main():
     # load metadata library
-    load_mdlib(['mdlib'])
     from mdgrass import GrassMD
 
     if not options['output']:

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	2015-10-04 10:45:59 UTC (rev 66407)
+++ grass-addons/grass7/gui/wxpython/wx.metadata/v.info.iso/v.info.iso.py	2015-10-04 11:56:04 UTC (rev 66408)
@@ -37,20 +37,12 @@
 import sys
 
 from grass.script import parser, fatal
-from grass.pygrass.utils import get_lib_path
+from grass.pygrass.utils import set_path
 
+set_path(modulename='wx.metadata', dirname='mdlib')
 
-def load_mdlib(libs):
-    for lib in libs:
-        path = get_lib_path(modname='wx.metadata', libname=lib)
-        if path is not None and path not in sys.path:
-            sys.path.append(path)
-        elif path is  None:
-            fatal("Fatal error: library < %s > not found "%lib)
-
 def main():
     # load metadata library
-    load_mdlib(['mdlib'])
     from mdgrass import GrassMD
 
     if not options['output']:



More information about the grass-commit mailing list