[GRASS-SVN] r56941 - in grass/trunk: gui/wxpython gui/wxpython/core gui/wxpython/dbmgr gui/wxpython/gmodeler gui/wxpython/gui_core gui/wxpython/iclass gui/wxpython/lmgr gui/wxpython/location_wizard gui/wxpython/mapdisp gui/wxpython/mapswipe gui/wxpython/modules gui/wxpython/psmap gui/wxpython/rlisetup gui/wxpython/scripts gui/wxpython/vdigit gui/wxpython/web_services lib/init
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 26 15:25:33 PDT 2013
Author: hamish
Date: 2013-06-26 15:25:33 -0700 (Wed, 26 Jun 2013)
New Revision: 56941
Modified:
grass/trunk/gui/wxpython/core/globalvar.py
grass/trunk/gui/wxpython/core/menutree.py
grass/trunk/gui/wxpython/core/toolboxes.py
grass/trunk/gui/wxpython/core/utils.py
grass/trunk/gui/wxpython/dbmgr/base.py
grass/trunk/gui/wxpython/dbmgr/g.gui.dbmgr.py
grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py
grass/trunk/gui/wxpython/gis_set.py
grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py
grass/trunk/gui/wxpython/gui_core/forms.py
grass/trunk/gui/wxpython/gui_core/goutput.py
grass/trunk/gui/wxpython/gui_core/query.py
grass/trunk/gui/wxpython/gui_core/treeview.py
grass/trunk/gui/wxpython/iclass/frame.py
grass/trunk/gui/wxpython/iclass/g.gui.iclass.py
grass/trunk/gui/wxpython/lmgr/frame.py
grass/trunk/gui/wxpython/location_wizard/dialogs.py
grass/trunk/gui/wxpython/mapdisp/frame.py
grass/trunk/gui/wxpython/mapdisp/main.py
grass/trunk/gui/wxpython/mapdisp/overlays.py
grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py
grass/trunk/gui/wxpython/modules/mcalc_builder.py
grass/trunk/gui/wxpython/modules/vclean.py
grass/trunk/gui/wxpython/psmap/g.gui.psmap.py
grass/trunk/gui/wxpython/rlisetup/g.gui.rlisetup.py
grass/trunk/gui/wxpython/rlisetup/wizard.py
grass/trunk/gui/wxpython/scripts/vkrige.py
grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py
grass/trunk/gui/wxpython/web_services/cap_interface.py
grass/trunk/gui/wxpython/web_services/widgets.py
grass/trunk/gui/wxpython/wxgui.py
grass/trunk/lib/init/grass.py
Log:
avoid repetition in PYTHONPATH
Modified: grass/trunk/gui/wxpython/core/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/core/globalvar.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/core/globalvar.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -27,7 +27,9 @@
from core.debug import Debug
-sys.path.append(os.path.join(ETCDIR, "python"))
+if os.path.join(ETCDIR, "python") not in sys.path:
+ sys.path.append(os.path.join(ETCDIR, "python"))
+
from grass.script.core import get_commands
Modified: grass/trunk/gui/wxpython/core/menutree.py
===================================================================
--- grass/trunk/gui/wxpython/core/menutree.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/core/menutree.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -43,7 +43,10 @@
import wx
if __name__ == '__main__':
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
+
from core.treemodel import TreeModel, ModuleNode
from core.settings import UserSettings
@@ -217,7 +220,9 @@
elif arg in ('manager', 'modeler', 'psmap'):
menu = arg
- sys.path.append(os.path.join(os.getenv("GISBASE"), "etc", "gui", "wxpython"))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
# FIXME: cross-dependencies
if menu == 'manager':
Modified: grass/trunk/gui/wxpython/core/toolboxes.py
===================================================================
--- grass/trunk/gui/wxpython/core/toolboxes.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/core/toolboxes.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -32,7 +32,9 @@
if __name__ == '__main__':
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
from core.globalvar import ETCWXDIR
from core.utils import GetSettingsPath
Modified: grass/trunk/gui/wxpython/core/utils.py
===================================================================
--- grass/trunk/gui/wxpython/core/utils.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/core/utils.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -22,7 +22,8 @@
import inspect
from core.globalvar import ETCDIR
-sys.path.append(os.path.join(ETCDIR, "python"))
+if os.path.join(ETCDIR, "python") not in sys.path:
+ sys.path.append(os.path.join(ETCDIR, "python"))
from grass.script import core as grass
from grass.script import task as gtask
Modified: grass/trunk/gui/wxpython/dbmgr/base.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/base.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/dbmgr/base.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -33,7 +33,10 @@
import types
if __name__ == "__main__":
- sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
+
from core import globalvar
import wx
import wx.lib.mixins.listctrl as listmix
Modified: grass/trunk/gui/wxpython/dbmgr/g.gui.dbmgr.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/g.gui.dbmgr.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/dbmgr/g.gui.dbmgr.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -37,7 +37,9 @@
import grass.script as grass
-sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
from dbmgr.manager import AttributeManager
Modified: grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/dbmgr/sqlbuilder.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -28,7 +28,10 @@
import sys
if __name__ == "__main__":
- sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
+
from core import globalvar
import wx
Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/gis_set.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -33,7 +33,10 @@
gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
if __name__ == "__main__":
- sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
+
from core import globalvar
import wx
import wx.lib.mixins.listctrl as listmix
Modified: grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/gmodeler/g.gui.gmodeler.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -42,7 +42,9 @@
import grass.script as grass
-sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
from core.giface import StandaloneGrassInterface
from core.globalvar import CheckWxVersion
Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/gui_core/forms.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -66,7 +66,8 @@
else:
wxbase = os.path.join(gisbase, 'etc', 'gui', 'wxpython')
-sys.path.append(wxbase)
+if wxbase not in sys.path:
+ sys.path.append(wxbase)
from core import globalvar
import wx
@@ -480,6 +481,7 @@
self.Bind(wx.EVT_MENU, self.OnCancel, id=wx.ID_CLOSE)
accelTableList = [(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, wx.ID_CLOSE)]
accelTableList = [(wx.ACCEL_CTRL, ord('Q'), wx.ID_CLOSE)]
+ # TODO: bind Ctrl-t for tile windows here (trac #2004)
if self.get_dcmd is not None: # A callback has been set up
btn_apply = wx.Button(parent = self.panel, id = wx.ID_APPLY)
Modified: grass/trunk/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/goutput.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/gui_core/goutput.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -23,7 +23,9 @@
import sys
import textwrap
-sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
import wx
from wx import stc
Modified: grass/trunk/gui/wxpython/gui_core/query.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/query.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/gui_core/query.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -18,7 +18,9 @@
import wx
if __name__ == '__main__':
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
from gui_core.treeview import TreeListView
from core.treemodel import TreeModel, DictNode
Modified: grass/trunk/gui/wxpython/gui_core/treeview.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/treeview.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/gui_core/treeview.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -25,7 +25,9 @@
import wx.gizmos as gizmos
if __name__ == '__main__':
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
from core.globalvar import hasAgw
from core.treemodel import TreeModel, DictNode
Modified: grass/trunk/gui/wxpython/iclass/frame.py
===================================================================
--- grass/trunk/gui/wxpython/iclass/frame.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/iclass/frame.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -23,7 +23,10 @@
import tempfile
if __name__ == "__main__":
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
+
from core import globalvar
import wx
Modified: grass/trunk/gui/wxpython/iclass/g.gui.iclass.py
===================================================================
--- grass/trunk/gui/wxpython/iclass/g.gui.iclass.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/iclass/g.gui.iclass.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -56,7 +56,9 @@
import grass.script as grass
if __name__ == '__main__':
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+ wxbase = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if wxbase not in sys.path:
+ sys.path.append(wxbase)
from core.settings import UserSettings
from core.globalvar import CheckWxVersion
Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/lmgr/frame.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -37,7 +37,9 @@
except ImportError:
import wx.lib.flatnotebook as FN
-sys.path.append(os.path.join(globalvar.ETCDIR, "python"))
+if os.path.join(globalvar.ETCDIR, "python") not in sys.path:
+ sys.path.append(os.path.join(globalvar.ETCDIR, "python"))
+
from grass.script import core as grass
from core.gcmd import RunCommand, GError, GMessage, GException
Modified: grass/trunk/gui/wxpython/location_wizard/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/location_wizard/dialogs.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/location_wizard/dialogs.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -24,7 +24,9 @@
import wx.lib.scrolledpanel as scrolled
if __name__ == '__main__':
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+ wxbase = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if wxbase not in sys.path:
+ sys.path.append(wxbase)
from core import globalvar
from core.gcmd import RunCommand
Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -31,8 +31,10 @@
import wx
import wx.aui
-sys.path.append(os.path.join(globalvar.ETCWXDIR, "icons"))
-sys.path.append(os.path.join(globalvar.ETCDIR, "python"))
+if os.path.join(globalvar.ETCWXDIR, "icons") not in sys.path:
+ sys.path.append(os.path.join(globalvar.ETCWXDIR, "icons"))
+if os.path.join(globalvar.ETCDIR, "python") not in sys.path:
+ sys.path.append(os.path.join(globalvar.ETCDIR, "python"))
from core import globalvar
from core.render import Map
Modified: grass/trunk/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/main.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/mapdisp/main.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -30,7 +30,10 @@
import sys
if __name__ == "__main__":
- sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
+
from core import globalvar
import wx
Modified: grass/trunk/gui/wxpython/mapdisp/overlays.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/overlays.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/mapdisp/overlays.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -25,9 +25,9 @@
self._pdcType = 'image'
self._propwin = None
self._defaultAt = ''
- self._cmd = None # to be set by user
+ self._cmd = None # to be set by user
self._name = None # to be defined by subclass
- self._id = None # to be defined by subclass
+ self._id = None # to be defined by subclass
def SetCmd(self, cmd):
hasAt = False
@@ -103,7 +103,7 @@
self._overlay = self._renderer.AddOverlay(id = self._id, ltype = self._name,
command = self.cmd, active = False,
render = False, hidden = True)
- # check if successfull
+ # check if successful
def _update(self):
self._renderer.ChangeOverlay(id = self._id, command = self._cmd,
Modified: grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py
===================================================================
--- grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -54,7 +54,9 @@
import grass.script as grass
if __name__ == '__main__':
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+ wxbase = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if wxbase not in sys.path:
+ sys.path.append(wxbase)
from core.settings import UserSettings
from core.globalvar import CheckWxVersion
Modified: grass/trunk/gui/wxpython/modules/mcalc_builder.py
===================================================================
--- grass/trunk/gui/wxpython/modules/mcalc_builder.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/modules/mcalc_builder.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -24,7 +24,9 @@
import grass.script as grass
if __name__ == "__main__":
- sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
from core import globalvar
from core.gcmd import GError, RunCommand
Modified: grass/trunk/gui/wxpython/modules/vclean.py
===================================================================
--- grass/trunk/gui/wxpython/modules/vclean.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/modules/vclean.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -21,7 +21,9 @@
import wx.lib.scrolledpanel as scrolled
if __name__ == '__main__':
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
from core.gcmd import RunCommand, GError
from core import globalvar
Modified: grass/trunk/gui/wxpython/psmap/g.gui.psmap.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/g.gui.psmap.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/psmap/g.gui.psmap.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -40,7 +40,9 @@
import grass.script as grass
-sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+wxbase = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+if wxbase not in sys.path:
+ sys.path.append(wxbase)
from core.globalvar import CheckWxVersion
from psmap.frame import PsMapFrame
Modified: grass/trunk/gui/wxpython/rlisetup/g.gui.rlisetup.py
===================================================================
--- grass/trunk/gui/wxpython/rlisetup/g.gui.rlisetup.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/rlisetup/g.gui.rlisetup.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -33,7 +33,9 @@
import wx
import grass.script as grass
-sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+wxbase = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+if wxbase not in sys.path:
+ sys.path.append(wxbase)
from core.giface import StandaloneGrassInterface
from core.globalvar import CheckWxVersion
Modified: grass/trunk/gui/wxpython/rlisetup/wizard.py
===================================================================
--- grass/trunk/gui/wxpython/rlisetup/wizard.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/rlisetup/wizard.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -23,7 +23,9 @@
import sys
import os
-sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
+wxbase = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+if wxbase not in sys.path:
+ sys.path.append(wxbase)
import wx
import wx.wizard as wiz
Modified: grass/trunk/gui/wxpython/scripts/vkrige.py
===================================================================
--- grass/trunk/gui/wxpython/scripts/vkrige.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/scripts/vkrige.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -34,7 +34,8 @@
### wxGUI imports
GUIModulesPath = os.path.join(os.getenv("GISBASE"), "etc", "gui", "wxpython")
-sys.path.append(GUIModulesPath)
+if GUIModulesPath not in sys.path:
+ sys.path.append(GUIModulesPath)
from core import globalvar
from gui_core import gselect
Modified: grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/vdigit/g.gui.vdigit.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -39,7 +39,9 @@
import wx
if __name__ == '__main__':
- sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
from core.globalvar import CheckWxVersion
from mapdisp.frame import MapFrame
Modified: grass/trunk/gui/wxpython/web_services/cap_interface.py
===================================================================
--- grass/trunk/gui/wxpython/web_services/cap_interface.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/web_services/cap_interface.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -25,7 +25,8 @@
import sys
WMSLibPath = os.path.join(os.getenv("GISBASE"), "etc", "r.in.wms")
-sys.path.append(WMSLibPath)
+if WMSLibPath not in sys.path:
+ sys.path.append(WMSLibPath)
from wms_cap_parsers import WMSCapabilitiesTree, \
WMTSCapabilitiesTree, \
Modified: grass/trunk/gui/wxpython/web_services/widgets.py
===================================================================
--- grass/trunk/gui/wxpython/web_services/widgets.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/web_services/widgets.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -44,7 +44,9 @@
import grass.script as grass
-sys.path.append(os.path.join(os.getenv("GISBASE"), "etc", "r.in.wms"))
+rinwms_path = os.path.join(os.getenv("GISBASE"), "etc", "r.in.wms")
+if rinwms_path not in sys.path:
+ sys.path.append(rinwms_path)
from wms_base import WMSDriversInfo
Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/gui/wxpython/wxgui.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -23,7 +23,10 @@
import getopt
if __name__ == "__main__":
- sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
+ gui_wx_path = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
+ if gui_wx_path not in sys.path:
+ sys.path.append(gui_wx_path)
+
from core import globalvar
import wx
try:
Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py 2013-06-26 21:29:36 UTC (rev 56940)
+++ grass/trunk/lib/init/grass.py 2013-06-26 22:25:33 UTC (rev 56941)
@@ -611,8 +611,12 @@
os.F_OK):
fatal(_("Failed to create new location. The " \
"location <%s> already exists." % location_name))
- sys.path.append(gfile('etc', 'python'))
+
+ if gfile('etc', 'python') not in sys.path:
+ sys.path.append(gfile('etc', 'python'))
+
from grass.script import core as grass
+
try:
if geofile and geofile.find('EPSG:') > -1:
epsg = geofile.split(':', 1)[1]
More information about the grass-commit
mailing list