Browse Source

define GUIDIR
Rules: add wxpython dir to PYTHONPATH
wxGUI: moved to DISTDIR/gui
winGRASS: add wxpython to PYTHONPATH
d.mon: fix wxpython path
g.mapsets: fix makefile for GUI script
Add GUIDIR/scripts into path
fix g.mapsets -s
fix grass-interface.dtd location
(merger60006-15 + https://trac.osgeo.org/grass/changeset/60056 + r60063-65 + r60073-74 + https://trac.osgeo.org/grass/changeset/60114 + https://trac.osgeo.org/grass/changeset/60117 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@60119 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 11 years ago
parent
commit
3618eb3855
89 changed files with 207 additions and 545 deletions
  1. 1 1
      display/d.mon/main.c
  2. 1 1
      display/d.mon/start.c
  3. 1 1
      general/g.gui/main.c
  4. 1 8
      general/g.mapsets/Makefile
  5. 0 163
      general/g.mapsets/g.mapsets_picker.py
  6. 2 2
      general/g.mapsets/main.c
  7. 8 8
      gui/icons/Makefile
  8. 8 8
      gui/images/Makefile
  9. 6 6
      gui/scripts/Makefile
  10. 13 13
      gui/wxpython/Makefile
  11. 1 5
      gui/wxpython/animation/dialogs.py
  12. 1 3
      gui/wxpython/animation/frame.py
  13. 0 4
      gui/wxpython/animation/g.gui.animation.py
  14. 0 4
      gui/wxpython/animation/nviztask.py
  15. 0 2
      gui/wxpython/animation/provider.py
  16. 0 4
      gui/wxpython/animation/temporal_manager.py
  17. 1 1
      gui/wxpython/core/giface.py
  18. 10 10
      gui/wxpython/core/globalvar.py
  19. 4 13
      gui/wxpython/core/menutree.py
  20. 11 18
      gui/wxpython/core/toolboxes.py
  21. 0 3
      gui/wxpython/core/units.py
  22. 2 11
      gui/wxpython/core/utils.py
  23. 0 5
      gui/wxpython/dbmgr/base.py
  24. 0 5
      gui/wxpython/dbmgr/g.gui.dbmgr.py
  25. 1 1
      gui/wxpython/dbmgr/manager.py
  26. 1 6
      gui/wxpython/dbmgr/sqlbuilder.py
  27. 0 7
      gui/wxpython/gcp/g.gui.gcp.py
  28. 2 2
      gui/wxpython/gcp/manager.py
  29. 3 8
      gui/wxpython/gis_set.py
  30. 2 2
      gui/wxpython/gmodeler/dialogs.py
  31. 1 1
      gui/wxpython/gmodeler/frame.py
  32. 0 5
      gui/wxpython/gmodeler/g.gui.gmodeler.py
  33. 1 1
      gui/wxpython/gmodeler/menudata.py
  34. 1 1
      gui/wxpython/gmodeler/model.py
  35. 1 1
      gui/wxpython/gui_core/dialogs.py
  36. 10 16
      gui/wxpython/gui_core/forms.py
  37. 4 5
      gui/wxpython/gui_core/ghelp.py
  38. 0 5
      gui/wxpython/gui_core/goutput.py
  39. 1 1
      gui/wxpython/gui_core/gselect.py
  40. 1 1
      gui/wxpython/gui_core/mapdisp.py
  41. 2 2
      gui/wxpython/gui_core/preferences.py
  42. 0 6
      gui/wxpython/gui_core/query.py
  43. 0 6
      gui/wxpython/gui_core/simplelmgr.py
  44. 2 2
      gui/wxpython/gui_core/toolbars.py
  45. 1 6
      gui/wxpython/gui_core/treeview.py
  46. 0 5
      gui/wxpython/iclass/frame.py
  47. 0 6
      gui/wxpython/iclass/g.gui.iclass.py
  48. 1 1
      gui/wxpython/icons/grass_icons.py
  49. 1 1
      gui/wxpython/icons/icon.py
  50. 1 1
      gui/wxpython/iscatt/frame.py
  51. 1 4
      gui/wxpython/lmgr/frame.py
  52. 4 4
      gui/wxpython/lmgr/menudata.py
  53. 2 8
      gui/wxpython/location_wizard/dialogs.py
  54. 1 1
      gui/wxpython/location_wizard/wizard.py
  55. 0 5
      gui/wxpython/mapdisp/frame.py
  56. 0 5
      gui/wxpython/mapdisp/main.py
  57. 0 6
      gui/wxpython/mapdisp/test_mapdisp.py
  58. 0 6
      gui/wxpython/mapswipe/g.gui.mapswipe.py
  59. 1 1
      gui/wxpython/modules/colorrules.py
  60. 2 2
      gui/wxpython/modules/extensions.py
  61. 1 1
      gui/wxpython/modules/histogram.py
  62. 33 0
      gui/wxpython/modules/mapsets_picker.py
  63. 1 7
      gui/wxpython/modules/mcalc_builder.py
  64. 1 7
      gui/wxpython/modules/vclean.py
  65. 1 1
      gui/wxpython/nviz/preferences.py
  66. 5 5
      gui/wxpython/psmap/dialogs.py
  67. 1 1
      gui/wxpython/psmap/frame.py
  68. 0 5
      gui/wxpython/psmap/g.gui.psmap.py
  69. 1 1
      gui/wxpython/psmap/menudata.py
  70. 2 2
      gui/wxpython/rlisetup/frame.py
  71. 0 5
      gui/wxpython/rlisetup/g.gui.rlisetup.py
  72. 1 9
      gui/wxpython/rlisetup/sampling_frame.py
  73. 0 5
      gui/wxpython/rlisetup/wizard.py
  74. 4 8
      gui/wxpython/scripts/vkrige.py
  75. 2 5
      gui/wxpython/timeline/frame.py
  76. 1 5
      gui/wxpython/timeline/g.gui.timeline.py
  77. 0 2
      gui/wxpython/tools/update_menudata.py
  78. 0 6
      gui/wxpython/vdigit/g.gui.vdigit.py
  79. 2 1
      gui/wxpython/vdigit/toolbars.py
  80. 2 2
      gui/wxpython/vnet/dialogs.py
  81. 2 2
      gui/wxpython/vnet/widgets.py
  82. 1 6
      gui/wxpython/wxgui.py
  83. 2 2
      gui/wxpython/wxplot/base.py
  84. 8 3
      gui/xml/Makefile
  85. 2 1
      include/Make/Grass.make
  86. 4 2
      include/Make/Rules.make
  87. 1 1
      lib/gis/parser.c
  88. 9 9
      lib/init/grass.py
  89. 1 1
      mswindows/GRASS-Installer.nsi.tmpl

+ 1 - 1
display/d.mon/main.c

@@ -4,7 +4,7 @@
  * MODULE:       d.mon
  * MODULE:       d.mon
  * AUTHOR(S):    Martin Landa <landa.martin gmail.com>
  * AUTHOR(S):    Martin Landa <landa.martin gmail.com>
  * PURPOSE:      Controls graphics monitors for CLI
  * PURPOSE:      Controls graphics monitors for CLI
- * COPYRIGHT:    (C) 2011-2012 by Martin Landa, and the GRASS Development Team
+ * COPYRIGHT:    (C) 2011-2014 by Martin Landa, and the GRASS Development Team
  *
  *
  *               This program is free software under the GNU General
  *               This program is free software under the GNU General
  *               Public License (>=v2). Read the file COPYING that
  *               Public License (>=v2). Read the file COPYING that

+ 1 - 1
display/d.mon/start.c

@@ -39,7 +39,7 @@ void start_wx(const char *name, const char *tempfile,
     
     
     G_debug(3, "       mapfile = %s", map_value);
     G_debug(3, "       mapfile = %s", map_value);
 
 
-    sprintf(progname, "%s/etc/gui/wxpython/mapdisp/main.py", G_gisbase());
+    sprintf(progname, "%s/gui/wxpython/mapdisp/main.py", G_gisbase());
     if (width > 0)
     if (width > 0)
         sprintf(str_width, "%d", width);
         sprintf(str_width, "%d", width);
     else
     else

+ 1 - 1
general/g.gui/main.c

@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
     G_message(_("Launching <%s> GUI in the background, please wait..."), type->answer);
     G_message(_("Launching <%s> GUI in the background, please wait..."), type->answer);
 
 
     if (strcmp(type->answer, "wxpython") == 0) {
     if (strcmp(type->answer, "wxpython") == 0) {
-	sprintf(progname, "%s/etc/gui/wxpython/wxgui.py", G_gisbase());
+	sprintf(progname, "%s/gui/wxpython/wxgui.py", G_gisbase());
 	if (rc_file->answer) {
 	if (rc_file->answer) {
 	    G_spawn_ex(getenv("GRASS_PYTHON"), getenv("GRASS_PYTHON"), progname,
 	    G_spawn_ex(getenv("GRASS_PYTHON"), getenv("GRASS_PYTHON"), progname,
 		    "--workspace", rc_file->answer, SF_BACKGROUND, NULL);
 		    "--workspace", rc_file->answer, SF_BACKGROUND, NULL);

+ 1 - 8
general/g.mapsets/Makefile

@@ -2,17 +2,10 @@
 MODULE_TOPDIR = ../..
 MODULE_TOPDIR = ../..
 
 
 PGM = g.mapsets
 PGM = g.mapsets
-GUI = $(ETC)/gui/scripts/g.mapsets_picker.py
 
 
 LIBES = $(GISLIB)
 LIBES = $(GISLIB)
 DEPENDENCIES = $(GISDEP)
 DEPENDENCIES = $(GISDEP)
 
 
 include $(MODULE_TOPDIR)/include/Make/Module.make
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
 
-default: cmd $(GUI)
-
-$(ETC)/gui/scripts/%: % | $(ETC)/gui/scripts
-	$(INSTALL) $< $@
-
-$(ETC)/gui/scripts:
-	$(MKDIR) $@
+default: cmd

+ 0 - 163
general/g.mapsets/g.mapsets_picker.py

@@ -1,163 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import sys
-import pwd
-
-from grass.script import core as grass
-
-import wx
-import wx.lib.mixins.listctrl as listmix
-
-class MapsetsFrame(wx.Frame):
-    def __init__(self):
-        wx.Frame.__init__(self, parent = None, id = wx.ID_ANY,
-                          title = "Check mapsets to access")
-        
-        
-        self.SetMinSize((350, 400))
-
-        sizer = wx.BoxSizer(wx.VERTICAL)
-        
-        # list of mapsets
-        self.mapsetlb = CheckListMapset(parent = self)
-        self.mapsetlb.LoadData()
-        
-        sizer.Add(item = self.mapsetlb, proportion = 1,
-                  flag = wx.ALL | wx.EXPAND, border = 5)
-
-        
-        # dialog buttons
-        line = wx.StaticLine(parent = self, id = wx.ID_ANY,
-                             style = wx.LI_HORIZONTAL)
-        sizer.Add(item = line, proportion = 0,
-                  flag = wx.EXPAND | wx.ALIGN_CENTRE | wx.ALL, border = 5)
-        
-        btnsizer = wx.StdDialogButtonSizer()
-        btnOK = wx.Button(self, wx.ID_OK)
-        btnOK.Bind(wx.EVT_BUTTON, self.OnOK)
-        btnOK.SetToolTipString("Close dialog and apply changes")
-        btnOK.SetDefault()
-        btnsizer.AddButton(btnOK)
-        
-        btnCancel = wx.Button(self, wx.ID_CANCEL)
-        btnCancel.Bind(wx.EVT_BUTTON, self.OnCancel)
-        btnCancel.SetToolTipString("Close dialog and ignore changes")
-        btnsizer.AddButton(btnCancel)
-        btnsizer.Realize()
-        
-        sizer.Add(item = btnsizer, proportion = 0,
-                  flag = wx.EXPAND | wx.ALIGN_RIGHT | wx.ALL, border = 5)
-        
-        # do layout
-        self.Layout()
-        self.SetSizer(sizer)
-        sizer.Fit(self)
-
-    def GetMapsets(self):
-        """Get list of checked mapsets"""
-        ms = []
-        i = 0
-        for mset in self.mapsetlb.mapsets:
-            if self.mapsetlb.IsChecked(i):
-                ms.append(mset)
-            i += 1
-
-        return ms
-
-    def OnCancel(self, event):
-        """Button 'Cancel' pressed"""
-        self.Close()
-        
-    def OnOK(self, event):
-        """Button 'OK' pressed"""
-        mapsets = ','.join(self.GetMapsets())
-
-        grass.run_command('g.mapsets',
-                          quiet = True,
-                          mapset = mapsets,
-                          operation = 'set')
-        
-        self.Close()
-        
-class CheckListMapset(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.CheckListCtrlMixin):
-    """List of mapset/owner/group"""
-    def __init__(self, parent, pos = wx.DefaultPosition,
-                 log = None):
-        self.parent = parent
-        
-        wx.ListCtrl.__init__(self, parent, wx.ID_ANY,
-                             style = wx.LC_REPORT)
-        listmix.CheckListCtrlMixin.__init__(self)
-        self.log = log
-        
-        # setup mixins
-        listmix.ListCtrlAutoWidthMixin.__init__(self)
-    
-    def LoadData(self):
-        """Load data into list"""
-        self.InsertColumn(0, 'Mapset')
-        self.InsertColumn(1, 'Owner')
-        ### self.InsertColumn(2, 'Group')
-
-        gisenv = grass.gisenv()
-        locationPath = os.path.join(gisenv['GISDBASE'], gisenv['LOCATION_NAME'])
-        self.curr_mapset = gisenv['MAPSET']
-        
-        ret = grass.read_command('g.mapsets',
-                                 quiet = True,
-                                 flags = 'l',
-                                 sep = 'newline')
-        self.mapsets = []
-        if ret:
-            self.mapsets = ret.splitlines()
-            
-
-        ret = grass.read_command('g.mapsets',
-                                 quiet = True,
-                                 flags = 'p',
-                                 sep = 'newline')
-        mapsets_access = []
-        if ret:
-            mapsets_access = ret.splitlines()
-            
-        for mapset in self.mapsets:
-            index = self.InsertStringItem(sys.maxint, mapset)
-            mapsetPath = os.path.join(locationPath,
-                                      mapset)
-            stat_info = os.stat(mapsetPath)
-            if os.name in ('posix', 'mac'):
-                self.SetStringItem(index, 1, "%s" % pwd.getpwuid(stat_info.st_uid)[0])
-                # FIXME: get group name
-                ### self.SetStringItem(index, 2, "%-8s" % stat_info.st_gid) 
-            else:
-                # FIXME: no pwd under MS Windows (owner: 0, group: 0)
-                self.SetStringItem(index, 1, "%-8s" % stat_info.st_uid)
-                ### self.SetStringItem(index, 2, "%-8s" % stat_info.st_gid)
-
-            if mapset in mapsets_access:
-                self.CheckItem(self.mapsets.index(mapset), True)
-            
-        self.SetColumnWidth(col = 0, width = wx.LIST_AUTOSIZE)
-        self.SetColumnWidth(col = 1, width = wx.LIST_AUTOSIZE)
-
-    def OnCheckItem(self, index, flag):
-        """Mapset checked/unchecked"""
-        mapset = self.mapsets[index]
-        if mapset == 'PERMANENT' or mapset == self.curr_mapset:
-            self.CheckItem(index, True)
-    
-class MyApp(wx.App):
-    def OnInit(self):
-        frame = MapsetsFrame()
-        
-        frame.CentreOnScreen()
-        frame.Show()
-        
-        self.SetTopWindow(frame)
-        
-        return True
-
-if __name__ == "__main__":
-    app = MyApp(0)
-    app.MainLoop()

+ 2 - 2
general/g.mapsets/main.c

@@ -158,8 +158,8 @@ int main(int argc, char *argv[])
     if (opt.dialog->answer) {
     if (opt.dialog->answer) {
         if (opt.mapset->answer)
         if (opt.mapset->answer)
             G_warning(_("Option <%s> ignored"), opt.mapset->key);
             G_warning(_("Option <%s> ignored"), opt.mapset->key);
-        sprintf(path_buf, "%s/etc/gui/scripts/g.mapsets_picker.py", G_gisbase());
-        G_spawn(getenv("GRASS_PYTHON"), "g.mapsets_picker.py", path_buf, NULL);
+        sprintf(path_buf, "%s/gui/wxpython/modules/mapsets_picker.py", G_gisbase());
+        G_spawn(getenv("GRASS_PYTHON"), "mapsets_picker.py", path_buf, NULL);
         exit(EXIT_SUCCESS);
         exit(EXIT_SUCCESS);
     }
     }
 
 

+ 8 - 8
gui/icons/Makefile

@@ -5,14 +5,14 @@ include $(MODULE_TOPDIR)/include/Make/Dir.make
 SRCICO := $(wildcard *.ico *.png)
 SRCICO := $(wildcard *.ico *.png)
 SRCICONS := $(wildcard grass/*.png)
 SRCICONS := $(wildcard grass/*.png)
 SRCFLAGS := $(wildcard flags/*.png)
 SRCFLAGS := $(wildcard flags/*.png)
-ETCICONS := $(patsubst %,$(ETC)/gui/icons/%,$(SRCICONS) $(SRCICO) $(SRCFLAGS))
+ETCICONS := $(patsubst %,$(GUIDIR)/icons/%,$(SRCICONS) $(SRCICO) $(SRCFLAGS))
 HTMLICONS := $(patsubst grass/%,$(HTMLDIR)/icons/%,$(SRCICONS))
 HTMLICONS := $(patsubst grass/%,$(HTMLDIR)/icons/%,$(SRCICONS))
 
 
-ETCDIRS = \
-	$(ETC)/gui \
-	$(ETC)/gui/icons \
-	$(ETC)/gui/icons/grass \
-	$(ETC)/gui/icons/flags
+DSTDIRS = \
+	$(GUIDIR) \
+	$(GUIDIR)/icons \
+	$(GUIDIR)/icons/grass \
+	$(GUIDIR)/icons/flags
 
 
 HTMLDIRS = \
 HTMLDIRS = \
 	$(HTMLDIR)/icons
 	$(HTMLDIR)/icons
@@ -21,11 +21,11 @@ default: $(ETCICONS) $(HTMLICONS)
 	$(MKDIR) $(ARCH_DISTDIR)/share/applications
 	$(MKDIR) $(ARCH_DISTDIR)/share/applications
 	$(INSTALL_DATA) grass.desktop $(ARCH_DISTDIR)/share/applications
 	$(INSTALL_DATA) grass.desktop $(ARCH_DISTDIR)/share/applications
 
 
-$(ETC)/gui/icons/%: % | $(ETCDIRS)
+$(GUIDIR)/icons/%: % | $(DSTDIRS)
 	$(INSTALL_DATA) $< $@
 	$(INSTALL_DATA) $< $@
 
 
 $(HTMLDIR)/icons/%: grass/% | $(HTMLDIRS)
 $(HTMLDIR)/icons/%: grass/% | $(HTMLDIRS)
 	$(INSTALL_DATA) $< $@
 	$(INSTALL_DATA) $< $@
 
 
-$(ETCDIRS) $(HTMLDIRS): %:
+$(DSTDIRS) $(HTMLDIRS): %:
 	$(MKDIR) $@
 	$(MKDIR) $@

+ 8 - 8
gui/images/Makefile

@@ -2,34 +2,34 @@ MODULE_TOPDIR = ../..
 
 
 include $(MODULE_TOPDIR)/include/Make/Other.make
 include $(MODULE_TOPDIR)/include/Make/Other.make
 
 
-ETCDIR = $(ETC)/gui/images
+DSTDIR = $(GUIDIR)/images
 
 
 # images
 # images
 IMGSRC := $(wildcard *.png)
 IMGSRC := $(wildcard *.png)
-IMGDST := $(patsubst %,$(ETCDIR)/%,$(IMGSRC))
+IMGDST := $(patsubst %,$(DSTDIR)/%,$(IMGSRC))
 
 
 # symbols
 # symbols
 CATEGORIES = basic demo extra geology n_arrows
 CATEGORIES = basic demo extra geology n_arrows
 SYMSRC := $(foreach dir,$(CATEGORIES),$(wildcard symbols/$(dir)/*.png))
 SYMSRC := $(foreach dir,$(CATEGORIES),$(wildcard symbols/$(dir)/*.png))
-SYMDST := $(patsubst symbols/%,$(ETCDIR)/symbols/%,$(SYMSRC))
+SYMDST := $(patsubst symbols/%,$(DSTDIR)/symbols/%,$(SYMSRC))
 
 
 default: $(IMGDST) $(SYMDST)
 default: $(IMGDST) $(SYMDST)
 
 
 define symbols_rule
 define symbols_rule
-$(ETCDIR)/symbols/$(1)/%.png: symbols/$(1)/%.png | $(ETCDIR)/symbols/$(1)
+$(DSTDIR)/symbols/$(1)/%.png: symbols/$(1)/%.png | $(DSTDIR)/symbols/$(1)
 	$(INSTALL_DATA) $$< $$@
 	$(INSTALL_DATA) $$< $$@
 
 
-$(ETCDIR)/symbols/$(1): | $(ETCDIR)/symbols
+$(DSTDIR)/symbols/$(1): | $(DSTDIR)/symbols
 	$(MKDIR) $$@
 	$(MKDIR) $$@
 endef
 endef
 
 
 $(foreach category,$(CATEGORIES),$(eval $(call symbols_rule,$(category))))
 $(foreach category,$(CATEGORIES),$(eval $(call symbols_rule,$(category))))
 
 
-$(ETCDIR)/%.png: %.png | $(ETCDIR)
+$(DSTDIR)/%.png: %.png | $(DSTDIR)
 	$(INSTALL_DATA) $< $@
 	$(INSTALL_DATA) $< $@
 
 
-$(ETCDIR):
+$(DSTDIR):
 	$(MKDIR) $@
 	$(MKDIR) $@
 
 
-$(ETCDIR)/symbols: $(ETCDIR)
+$(DSTDIR)/symbols: $(DSTDIR)
 	$(MKDIR) $@
 	$(MKDIR) $@

+ 6 - 6
gui/scripts/Makefile

@@ -4,21 +4,21 @@ include $(MODULE_TOPDIR)/include/Make/Rules.make
 include $(MODULE_TOPDIR)/include/Make/Vars.make
 include $(MODULE_TOPDIR)/include/Make/Vars.make
 include $(MODULE_TOPDIR)/include/Make/Python.make
 include $(MODULE_TOPDIR)/include/Make/Python.make
 
 
-SCRIPTDIR = $(ETC)/gui/scripts
+DSTDIR = $(GUIDIR)/scripts
 
 
 ifdef MINGW
 ifdef MINGW
-PYFILES := $(patsubst %.py, $(SCRIPTDIR)/%.py, $(filter %.py, $(PY_SOURCES)))
+PYFILES := $(patsubst %.py, $(DSTDIR)/%.py, $(filter %.py, $(PY_SOURCES)))
 else
 else
-PYFILES := $(patsubst %.py, $(SCRIPTDIR)/%, $(filter %.py, $(PY_SOURCES)))
+PYFILES := $(patsubst %.py, $(DSTDIR)/%, $(filter %.py, $(PY_SOURCES)))
 endif
 endif
 
 
 default: $(PYFILES)
 default: $(PYFILES)
 
 
-$(SCRIPTDIR)/%: %.py | $(SCRIPTDIR)
+$(DSTDIR)/%: %.py | $(DSTDIR)
 	$(INSTALL) $< $@
 	$(INSTALL) $< $@
 
 
-$(SCRIPTDIR)/%.py: %.py | $(SCRIPTDIR)
+$(DSTDIR)/%.py: %.py | $(DSTDIR)
 	$(INSTALL) $< $@
 	$(INSTALL) $< $@
 
 
-$(SCRIPTDIR):
+$(DSTDIR):
 	-test -d $@ | $(MKDIR) $@
 	-test -d $@ | $(MKDIR) $@

+ 13 - 13
gui/wxpython/Makefile

@@ -7,7 +7,7 @@ include $(MODULE_TOPDIR)/include/Make/Dir.make
 include $(MODULE_TOPDIR)/include/Make/Doxygen.make
 include $(MODULE_TOPDIR)/include/Make/Doxygen.make
 include $(MODULE_TOPDIR)/include/Make/Python.make
 include $(MODULE_TOPDIR)/include/Make/Python.make
 
 
-ETCDIR = $(ETC)/gui/wxpython
+DSTDIR = $(GUIDIR)/wxpython
 
 
 SRCFILES := $(wildcard icons/*.py scripts/*.py xml/*) \
 SRCFILES := $(wildcard icons/*.py scripts/*.py xml/*) \
 	$(wildcard animation/* core/*.py dbmgr/* gcp/*.py gmodeler/* \
 	$(wildcard animation/* core/*.py dbmgr/* gcp/*.py gmodeler/* \
@@ -16,25 +16,25 @@ SRCFILES := $(wildcard icons/*.py scripts/*.py xml/*) \
 	vnet/*.py web_services/*.py wxplot/*.py iscatt/*.py) \
 	vnet/*.py web_services/*.py wxplot/*.py iscatt/*.py) \
 	gis_set.py gis_set_error.py wxgui.py README
 	gis_set.py gis_set_error.py wxgui.py README
 
 
-DSTFILES := $(patsubst %,$(ETCDIR)/%,$(SRCFILES)) \
-	$(patsubst %.py,$(ETCDIR)/%.pyc,$(filter %.py,$(SRCFILES)))
+DSTFILES := $(patsubst %,$(DSTDIR)/%,$(SRCFILES)) \
+	$(patsubst %.py,$(DSTDIR)/%.pyc,$(filter %.py,$(SRCFILES)))
 
 
-PYDSTDIRS := $(patsubst %,$(ETCDIR)/%,animation core dbmgr gcp gmodeler \
+PYDSTDIRS := $(patsubst %,$(DSTDIR)/%,animation core dbmgr gcp gmodeler \
 	gui_core iclass lmgr location_wizard mapwin mapdisp modules nviz psmap \
 	gui_core iclass lmgr location_wizard mapwin mapdisp modules nviz psmap \
 	mapswipe vdigit wxplot web_services rlisetup vnet timeline iscatt)
 	mapswipe vdigit wxplot web_services rlisetup vnet timeline iscatt)
 
 
 
 
-DSTDIRS := $(patsubst %,$(ETCDIR)/%,icons scripts xml)
+DSTDIRS := $(patsubst %,$(DSTDIR)/%,icons scripts xml)
 
 
 default: $(DSTFILES)
 default: $(DSTFILES)
-	-$(MAKE) $(ETCDIR)/xml/module_items.xml
+	-$(MAKE) $(DSTDIR)/xml/module_items.xml
 	-$(MAKE) xml/menudata.xml
 	-$(MAKE) xml/menudata.xml
 	-$(MAKE) xml/module_tree_menudata.xml
 	-$(MAKE) xml/module_tree_menudata.xml
 	-$(MAKE) menustrings.py
 	-$(MAKE) menustrings.py
 	$(MAKE) parsubdirs
 	$(MAKE) parsubdirs
 
 
 
 
-$(ETCDIR)/%: % | $(PYDSTDIRS) $(DSTDIRS)
+$(DSTDIR)/%: % | $(PYDSTDIRS) $(DSTDIRS)
 	$(INSTALL_DATA) $< $@
 	$(INSTALL_DATA) $< $@
 
 
 xml/menudata.xml: core/toolboxes.py
 xml/menudata.xml: core/toolboxes.py
@@ -43,24 +43,24 @@ xml/menudata.xml: core/toolboxes.py
 xml/module_tree_menudata.xml: core/toolboxes.py
 xml/module_tree_menudata.xml: core/toolboxes.py
 	$(call run_grass,$(PYTHON) $< "module_tree" > $@)
 	$(call run_grass,$(PYTHON) $< "module_tree" > $@)
 
 
-menustrings.py: core/menutree.py $(ETCDIR)/xml/menudata.xml $(ETCDIR)/xml/module_tree_menudata.xml $(ETCDIR)/xml/menudata_modeler.xml $(ETCDIR)/xml/menudata_psmap.xml
+menustrings.py: core/menutree.py $(DSTDIR)/xml/menudata.xml $(DSTDIR)/xml/module_tree_menudata.xml $(DSTDIR)/xml/menudata_modeler.xml $(DSTDIR)/xml/menudata_psmap.xml
 	@echo "# This is a generated file.\n" > $@
 	@echo "# This is a generated file.\n" > $@
 	$(call run_grass,$(PYTHON) $< "manager" >> $@)
 	$(call run_grass,$(PYTHON) $< "manager" >> $@)
 	$(call run_grass,$(PYTHON) $< "module_tree" >> $@)
 	$(call run_grass,$(PYTHON) $< "module_tree" >> $@)
 	$(call run_grass,$(PYTHON) $< "modeler" >> $@)
 	$(call run_grass,$(PYTHON) $< "modeler" >> $@)
 	$(call run_grass,$(PYTHON) $< "psmap" >> $@)
 	$(call run_grass,$(PYTHON) $< "psmap" >> $@)
 
 
-$(ETCDIR)/xml/module_items.xml: tools/build_modules_xml.py
+$(DSTDIR)/xml/module_items.xml: tools/build_modules_xml.py
 	@echo "Generating interface description for all modules..."
 	@echo "Generating interface description for all modules..."
 	$(call run_grass,$(PYTHON) $< > $@)
 	$(call run_grass,$(PYTHON) $< > $@)
-	
-$(PYDSTDIRS): %: | $(ETCDIR)
+
+$(PYDSTDIRS): %: | $(DSTDIR)
 	$(MKDIR) $@
 	$(MKDIR) $@
 
 
-$(DSTDIRS): %: | $(ETCDIR)
+$(DSTDIRS): %: | $(DSTDIR)
 	$(MKDIR) $@
 	$(MKDIR) $@
 
 
-$(ETCDIR):
+$(DSTDIR):
 	$(MKDIR) $@
 	$(MKDIR) $@
 
 
 #doxygen:
 #doxygen:

+ 1 - 5
gui/wxpython/animation/dialogs.py

@@ -20,7 +20,6 @@ This program is free software under the GNU General Public License
 @author Anna Petrasova <kratochanna gmail.com>
 @author Anna Petrasova <kratochanna gmail.com>
 """
 """
 import os
 import os
-import sys
 import wx
 import wx
 import copy
 import copy
 import datetime
 import datetime
@@ -28,9 +27,6 @@ import wx.lib.filebrowsebutton as filebrowse
 import wx.lib.scrolledpanel as SP
 import wx.lib.scrolledpanel as SP
 import wx.lib.colourselect as csel
 import wx.lib.colourselect as csel
 
 
-if __name__ == '__main__':
-    sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
-
 from core.gcmd import GMessage, GError, GException
 from core.gcmd import GMessage, GError, GException
 from core import globalvar
 from core import globalvar
 from gui_core.dialogs import MapLayersDialog, GetImageHandlers
 from gui_core.dialogs import MapLayersDialog, GetImageHandlers
@@ -1274,7 +1270,7 @@ class AddTemporalLayerDialog(wx.Dialog):
 
 
         self.tselect = Select(parent=self, type='strds')
         self.tselect = Select(parent=self, type='strds')
         iconTheme = UserSettings.Get(group='appearance', key='iconTheme', subkey='type')
         iconTheme = UserSettings.Get(group='appearance', key='iconTheme', subkey='type')
-        bitmapPath = os.path.join(globalvar.ETCICONDIR, iconTheme, 'layer-open.png')
+        bitmapPath = os.path.join(globalvar.ICONDIR, iconTheme, 'layer-open.png')
         if os.path.isfile(bitmapPath) and os.path.getsize(bitmapPath):
         if os.path.isfile(bitmapPath) and os.path.getsize(bitmapPath):
             bitmap = wx.Bitmap(name=bitmapPath)
             bitmap = wx.Bitmap(name=bitmapPath)
         else:
         else:

+ 1 - 3
gui/wxpython/animation/frame.py

@@ -23,8 +23,6 @@ import wx
 import wx.aui
 import wx.aui
 import tempfile
 import tempfile
 
 
-if __name__ == '__main__':
-    sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
 import grass.script as gcore
 import grass.script as gcore
 import grass.temporal as tgis
 import grass.temporal as tgis
 from core import globalvar
 from core import globalvar
@@ -57,7 +55,7 @@ class AnimationFrame(wx.Frame):
         self.SetClientSize(self.GetSize())
         self.SetClientSize(self.GetSize())
         self.iconsize = (16, 16)
         self.iconsize = (16, 16)
 
 
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_map.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass_map.ico'), wx.BITMAP_TYPE_ICO))
 
 
         # Make sure the temporal database exists
         # Make sure the temporal database exists
         tgis.init()
         tgis.init()

+ 0 - 4
gui/wxpython/animation/g.gui.animation.py

@@ -51,16 +51,12 @@
 #%end
 #%end
 
 
 import os
 import os
-import sys
 
 
 import wx
 import wx
 
 
 import grass.script as grass
 import grass.script as grass
 import grass.temporal as tgis
 import grass.temporal as tgis
 
 
-if __name__ == '__main__':
-    sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
-
 from core.globalvar import CheckWxVersion
 from core.globalvar import CheckWxVersion
 from core.utils import _, GuiModuleMain
 from core.utils import _, GuiModuleMain
 from core.giface import StandaloneGrassInterface
 from core.giface import StandaloneGrassInterface

+ 0 - 4
gui/wxpython/animation/nviztask.py

@@ -15,15 +15,11 @@ This program is free software under the GNU General Public License
 """
 """
 
 
 import os
 import os
-import sys
 try:
 try:
     import xml.etree.ElementTree as etree
     import xml.etree.ElementTree as etree
 except ImportError:
 except ImportError:
     import elementtree.ElementTree as etree  # Python <= 2.4
     import elementtree.ElementTree as etree  # Python <= 2.4
 
 
-if __name__ == '__main__':
-    sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
-
 from core.workspace import ProcessWorkspaceFile
 from core.workspace import ProcessWorkspaceFile
 from core.gcmd import RunCommand, GException
 from core.gcmd import RunCommand, GException
 from core.utils import GetLayerNameFromCmd, CmdToTuple, _
 from core.utils import GetLayerNameFromCmd, CmdToTuple, _

+ 0 - 2
gui/wxpython/animation/provider.py

@@ -25,8 +25,6 @@ import sys
 import wx
 import wx
 import tempfile
 import tempfile
 from multiprocessing import Process, Queue
 from multiprocessing import Process, Queue
-if __name__ == '__main__':
-    sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
 
 
 from core.gcmd import RunCommand, GException
 from core.gcmd import RunCommand, GException
 from core.settings import UserSettings
 from core.settings import UserSettings

+ 0 - 4
gui/wxpython/animation/temporal_manager.py

@@ -18,12 +18,8 @@ This program is free software under the GNU General Public License
 """
 """
 
 
 import os
 import os
-import sys
 import datetime
 import datetime
 
 
-if __name__ == '__main__':
-    sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
-
 import grass.script as grass
 import grass.script as grass
 import grass.temporal as tgis
 import grass.temporal as tgis
 from core.gcmd import GException
 from core.gcmd import GException

+ 1 - 1
gui/wxpython/core/giface.py

@@ -6,7 +6,7 @@
 Classes:
 Classes:
  - giface::StandaloneGrassInterface
  - giface::StandaloneGrassInterface
 
 
-(C) 2012 by the GRASS Development Team
+(C) 2012-2014 by the GRASS Development Team
 
 
 This program is free software under the GNU General Public License
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
 (>=v2). Read the file COPYING that comes with GRASS for details.

+ 10 - 10
gui/wxpython/core/globalvar.py

@@ -3,7 +3,7 @@
 
 
 @brief Global variables used by wxGUI
 @brief Global variables used by wxGUI
 
 
-(C) 2007-2011 by the GRASS Development Team
+(C) 2007-2014 by the GRASS Development Team
 
 
 This program is free software under the GNU General Public License
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -19,11 +19,12 @@ if not os.getenv("GISBASE"):
     sys.exit("GRASS is not running. Exiting...")
     sys.exit("GRASS is not running. Exiting...")
 
 
 # path to python scripts
 # path to python scripts
-ETCDIR = os.path.join(os.getenv("GISBASE"), "etc")
-ETCICONDIR = os.path.join(os.getenv("GISBASE"), "etc", "gui", "icons")
-ETCWXDIR = os.path.join(ETCDIR, "gui", "wxpython")
-ETCIMGDIR = os.path.join(ETCDIR, "gui", "images")
-ETCSYMBOLDIR = os.path.join(ETCDIR, "gui", "images", "symbols")
+ETCDIR   = os.path.join(os.getenv("GISBASE"), "etc")
+GUIDIR   = os.path.join(os.getenv("GISBASE"), "gui")
+WXGUIDIR = os.path.join(GUIDIR, "wxpython")
+ICONDIR  = os.path.join(GUIDIR, "icons")
+IMGDIR   = os.path.join(GUIDIR, "images")
+SYMBDIR  = os.path.join(IMGDIR, "symbols")
 
 
 from core.debug import Debug
 from core.debug import Debug
 
 
@@ -38,12 +39,8 @@ except IOError:
         return string
         return string
     _ = null_gettext
     _ = null_gettext
 
 
-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
 from grass.script.core import get_commands
 
 
-
 def CheckWxVersion(version = [2, 8, 11, 0]):
 def CheckWxVersion(version = [2, 8, 11, 0]):
     """!Check wx version"""
     """!Check wx version"""
     ver = wx.version().split(' ')[0]
     ver = wx.version().split(' ')[0]
@@ -211,3 +208,6 @@ else:
 
 
 """@Check version of wxPython, use agwStyle for 2.8.11+"""
 """@Check version of wxPython, use agwStyle for 2.8.11+"""
 hasAgw = CheckWxVersion()
 hasAgw = CheckWxVersion()
+
+"""@Add GUIDIR/scripts into path"""
+os.environ['PATH'] = os.path.join(GUIDIR, 'scripts') + os.pathsep + os.environ['PATH']

+ 4 - 13
gui/wxpython/core/menutree.py

@@ -43,11 +43,6 @@ except ImportError:
 
 
 import wx
 import wx
 
 
-if __name__ == '__main__':
-    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.treemodel import TreeModel, ModuleNode
 from core.settings import UserSettings
 from core.settings import UserSettings
 from core.toolboxes import expandAddons as expAddons
 from core.toolboxes import expandAddons as expAddons
@@ -230,21 +225,17 @@ if __name__ == "__main__":
         elif arg in ('manager', 'module_tree', 'modeler', 'psmap'):
         elif arg in ('manager', 'module_tree', 'modeler', 'psmap'):
             menu = arg
             menu = arg
 
 
-    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
     # FIXME: cross-dependencies
     if menu == 'manager':
     if menu == 'manager':
         from lmgr.menudata     import LayerManagerMenuData
         from lmgr.menudata     import LayerManagerMenuData
-        from core.globalvar    import ETCWXDIR
-        filename = os.path.join(ETCWXDIR, 'xml', 'menudata.xml')
+        from core.globalvar    import WXGUIDIR
+        filename = os.path.join(WXGUIDIR, 'xml', 'menudata.xml')
         menudata = LayerManagerMenuData(filename)
         menudata = LayerManagerMenuData(filename)
     # FIXME: since module descriptions are used again we have now the third copy of the same string (one is in modules)
     # FIXME: since module descriptions are used again we have now the third copy of the same string (one is in modules)
     elif menu == 'module_tree':
     elif menu == 'module_tree':
         from lmgr.menudata import LayerManagerModuleTree
         from lmgr.menudata import LayerManagerModuleTree
-        from core.globalvar import ETCWXDIR
-        filename = os.path.join(ETCWXDIR, 'xml', 'module_tree_menudata.xml')
+        from core.globalvar import WXGUIDIR
+        filename = os.path.join(WXGUIDIR, 'xml', 'module_tree_menudata.xml')
         menudata = LayerManagerModuleTree(filename)
         menudata = LayerManagerModuleTree(filename)
     elif menu == 'modeler':
     elif menu == 'modeler':
         from gmodeler.menudata import ModelerMenuData
         from gmodeler.menudata import ModelerMenuData

+ 11 - 18
gui/wxpython/core/toolboxes.py

@@ -30,13 +30,7 @@ if sys.version_info[0:2] > (2, 6):
 else:
 else:
     has_xpath = False
     has_xpath = False
 
 
-
-if __name__ == '__main__':
-    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.globalvar import WXGUIDIR
 from core.utils import GetSettingsPath, _
 from core.utils import GetSettingsPath, _
 from core.gcmd import GError, RunCommand
 from core.gcmd import GError, RunCommand
 
 
@@ -47,10 +41,10 @@ from core.debug import Debug
 
 
 
 
 # this could be placed to functions
 # this could be placed to functions
-mainMenuFile = os.path.join(ETCWXDIR, 'xml', 'main_menu.xml')
-toolboxesFile = os.path.join(ETCWXDIR, 'xml', 'toolboxes.xml')
-wxguiItemsFile = os.path.join(ETCWXDIR, 'xml', 'wxgui_items.xml')
-moduleItemsFile = os.path.join(ETCWXDIR, 'xml', 'module_items.xml')
+mainMenuFile    = os.path.join(WXGUIDIR, 'xml', 'main_menu.xml')
+toolboxesFile   = os.path.join(WXGUIDIR, 'xml', 'toolboxes.xml')
+wxguiItemsFile  = os.path.join(WXGUIDIR, 'xml', 'wxgui_items.xml')
+moduleItemsFile = os.path.join(WXGUIDIR, 'xml', 'module_items.xml')
 
 
 userToolboxesFile = os.path.join(GetSettingsPath(), 'toolboxes', 'toolboxes.xml')
 userToolboxesFile = os.path.join(GetSettingsPath(), 'toolboxes', 'toolboxes.xml')
 userMainMenuFile = os.path.join(GetSettingsPath(), 'toolboxes', 'main_menu.xml')
 userMainMenuFile = os.path.join(GetSettingsPath(), 'toolboxes', 'main_menu.xml')
@@ -79,12 +73,11 @@ def getMenudataFile(userRootFile, newFile, fallback):
     """
     """
     Debug.msg(1, "toolboxes.getMenudataFile: {userRootFile}, {newFile}, {fallback}".format(**locals()))
     Debug.msg(1, "toolboxes.getMenudataFile: {userRootFile}, {newFile}, {fallback}".format(**locals()))
 
 
-    distributionRootFile = os.path.join(ETCWXDIR, 'xml', userRootFile)
+    distributionRootFile = os.path.join(WXGUIDIR, 'xml', userRootFile)
     userRootFile = os.path.join(GetSettingsPath(), 'toolboxes', userRootFile)
     userRootFile = os.path.join(GetSettingsPath(), 'toolboxes', userRootFile)
     if not os.path.exists(userRootFile):
     if not os.path.exists(userRootFile):
         userRootFile = None
         userRootFile = None
 
 
-    ##fallback = os.path.join(ETCWXDIR, 'xml', 'menudata.xml')
     # always create toolboxes directory if does not exist yet
     # always create toolboxes directory if does not exist yet
     tbDir = _setupToolboxes()
     tbDir = _setupToolboxes()
 
 
@@ -685,11 +678,11 @@ def module_test():
     """Tests the module using test files included in the current directory and
     """Tests the module using test files included in the current directory and
     in files from distribution.
     in files from distribution.
     """
     """
-    toolboxesFile = os.path.join(ETCWXDIR, 'xml', 'toolboxes.xml')
+    toolboxesFile   = os.path.join(WXGUIDIR, 'xml', 'toolboxes.xml')
     userToolboxesFile = 'test.toolboxes_user_toolboxes.xml'
     userToolboxesFile = 'test.toolboxes_user_toolboxes.xml'
     menuFile = 'test.toolboxes_menu.xml'
     menuFile = 'test.toolboxes_menu.xml'
-    wxguiItemsFile = os.path.join(ETCWXDIR, 'xml', 'wxgui_items.xml')
-    moduleItemsFile = os.path.join(ETCWXDIR, 'xml', 'module_items.xml')
+    wxguiItemsFile  = os.path.join(WXGUIDIR, 'xml', 'wxgui_items.xml')
+    moduleItemsFile = os.path.join(WXGUIDIR, 'xml', 'module_items.xml')
 
 
     toolboxes = etree.parse(toolboxesFile)
     toolboxes = etree.parse(toolboxesFile)
     userToolboxes = etree.parse(userToolboxesFile)
     userToolboxes = etree.parse(userToolboxesFile)
@@ -743,9 +736,9 @@ def main():
     """
     """
     # TODO: fix parameter handling
     # TODO: fix parameter handling
     if len(sys.argv) > 1:
     if len(sys.argv) > 1:
-        mainFile = os.path.join(ETCWXDIR, 'xml', 'module_tree.xml')
+        mainFile = os.path.join(WXGUIDIR, 'xml', 'module_tree.xml')
     else:
     else:
-        mainFile = os.path.join(ETCWXDIR, 'xml', 'main_menu.xml')
+        mainFile = os.path.join(WXGUIDIR, 'xml', 'main_menu.xml')
     tree = createTree(distributionRootFile=mainFile, userRootFile=None,
     tree = createTree(distributionRootFile=mainFile, userRootFile=None,
                       userDefined=False)
                       userDefined=False)
     root = tree.getroot()
     root = tree.getroot()

+ 0 - 3
gui/wxpython/core/units.py

@@ -27,9 +27,6 @@ import math
 if __name__ == '__main__':
 if __name__ == '__main__':
     import os
     import os
     import sys
     import sys
-    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.utils import _
 from core.utils import _
 
 

+ 2 - 11
gui/wxpython/core/utils.py

@@ -21,21 +21,12 @@ import shlex
 import re
 import re
 import inspect
 import inspect
 
 
-if __name__ == '__main__':
-    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 ETCDIR
-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 core as grass
 from grass.script import task as gtask
 from grass.script import task as gtask
 
 
+from core import globalvar
 from core.gcmd  import RunCommand
 from core.gcmd  import RunCommand
 from core.debug import Debug
 from core.debug import Debug
-# from core.settings import UserSettings
 
 
 try:
 try:
     # intended to be used also outside this module
     # intended to be used also outside this module
@@ -845,7 +836,7 @@ def GetSettingsPath():
     """!Get full path to the settings directory
     """!Get full path to the settings directory
     """
     """
     try:
     try:
-        verFd = open(os.path.join(ETCDIR, "VERSIONNUMBER"))
+        verFd = open(os.path.join(globalvar.ETCDIR, "VERSIONNUMBER"))
         version = int(verFd.readlines()[0].split(' ')[0].split('.')[0])
         version = int(verFd.readlines()[0].split(' ')[0].split('.')[0])
     except (IOError, ValueError, TypeError, IndexError), e:
     except (IOError, ValueError, TypeError, IndexError), e:
         sys.exit(_("ERROR: Unable to determine GRASS version. Details: %s") % e)
         sys.exit(_("ERROR: Unable to determine GRASS version. Details: %s") % e)

+ 0 - 5
gui/wxpython/dbmgr/base.py

@@ -34,11 +34,6 @@ import tempfile
 import copy
 import copy
 import types
 import types
 
 
-if __name__ == "__main__":
-    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 import globalvar
 import wx
 import wx
 import wx.lib.mixins.listctrl as listmix
 import wx.lib.mixins.listctrl as listmix

+ 0 - 5
gui/wxpython/dbmgr/g.gui.dbmgr.py

@@ -29,16 +29,11 @@
 #%end
 #%end
 
 
 import os
 import os
-import sys
 
 
 import  wx
 import  wx
 
 
 import grass.script as grass
 import grass.script as grass
 
 
-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.utils import _, GuiModuleMain
 from core.utils import _, GuiModuleMain
 from dbmgr.manager import AttributeManager
 from dbmgr.manager import AttributeManager
 
 

+ 1 - 1
gui/wxpython/dbmgr/manager.py

@@ -76,7 +76,7 @@ class AttributeManager(wx.Frame, DbMgrBase):
         self.SetTitle(title)
         self.SetTitle(title)
         
         
         # icon
         # icon
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_sql.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass_sql.ico'), wx.BITMAP_TYPE_ICO))
 
 
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
              
              

+ 1 - 6
gui/wxpython/dbmgr/sqlbuilder.py

@@ -27,11 +27,6 @@ This program is free software under the GNU General Public License
 import os
 import os
 import sys
 import sys
 
 
-if __name__ == "__main__":
-    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 import globalvar
 from core.utils import _
 from core.utils import _
 import wx
 import wx
@@ -51,7 +46,7 @@ class SQLBuilder(wx.Frame):
                  layer = 1):
                  layer = 1):
         wx.Frame.__init__(self, parent, id, title)
         wx.Frame.__init__(self, parent, id, title)
         
         
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_sql.ico'),
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass_sql.ico'),
                              wx.BITMAP_TYPE_ICO))
                              wx.BITMAP_TYPE_ICO))
         
         
         self.parent     = parent
         self.parent     = parent

+ 0 - 7
gui/wxpython/gcp/g.gui.gcp.py

@@ -33,17 +33,10 @@ Module to run GCP management tool as stadalone application.
 """
 """
 
 
 import os
 import os
-import sys
 import  wx
 import  wx
 
 
 import grass.script as grass
 import grass.script as grass
 
 
-# adding a path to wxGUI modules
-if __name__ == '__main__':
-    WXGUIBASE = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
-    if WXGUIBASE not in sys.path:
-        sys.path.append(WXGUIBASE)
-
 from core.settings import UserSettings
 from core.settings import UserSettings
 from core.globalvar import CheckWxVersion
 from core.globalvar import CheckWxVersion
 from core.giface import StandaloneGrassInterface
 from core.giface import StandaloneGrassInterface

+ 2 - 2
gui/wxpython/gcp/manager.py

@@ -65,7 +65,7 @@ tgt_map = { 'raster' : '',
 maptype = 'raster'
 maptype = 'raster'
 
 
 def getSmallUpArrowImage():
 def getSmallUpArrowImage():
-    stream = open(os.path.join(globalvar.ETCIMGDIR, 'small_up_arrow.png'), 'rb')
+    stream = open(os.path.join(globalvar.IMGDIR, 'small_up_arrow.png'), 'rb')
     try:
     try:
         img = wx.ImageFromStream(stream)
         img = wx.ImageFromStream(stream)
     finally:
     finally:
@@ -73,7 +73,7 @@ def getSmallUpArrowImage():
     return img
     return img
 
 
 def getSmallDnArrowImage():
 def getSmallDnArrowImage():
-    stream = open(os.path.join(globalvar.ETCIMGDIR, 'small_down_arrow.png'), 'rb')
+    stream = open(os.path.join(globalvar.IMGDIR, 'small_down_arrow.png'), 'rb')
     try:
     try:
         img = wx.ImageFromStream(stream)
         img = wx.ImageFromStream(stream)
     finally:
     finally:

+ 3 - 8
gui/wxpython/gis_set.py

@@ -28,11 +28,6 @@ import platform
 import codecs
 import codecs
 import getpass
 import getpass
 
 
-if __name__ == "__main__":
-    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 import globalvar
 from core.utils import _
 from core.utils import _
 import wx
 import wx
@@ -82,9 +77,9 @@ class GRASSStartup(wx.Frame):
         # image
         # image
         try:
         try:
             if os.getenv('ISISROOT'):
             if os.getenv('ISISROOT'):
-                name = os.path.join(globalvar.ETCDIR, "gui", "images", "startup_banner_isis.png")
+                name = os.path.join(globalvar.GUIDIR, "images", "startup_banner_isis.png")
             else:
             else:
-                name = os.path.join(globalvar.ETCDIR, "gui", "images", "startup_banner.png")
+                name = os.path.join(globalvar.GUIDIR, "images", "startup_banner.png")
             self.hbitmap = wx.StaticBitmap(self.panel, wx.ID_ANY,
             self.hbitmap = wx.StaticBitmap(self.panel, wx.ID_ANY,
                                            wx.Bitmap(name = name,
                                            wx.Bitmap(name = name,
                                                      type = wx.BITMAP_TYPE_PNG))
                                                      type = wx.BITMAP_TYPE_PNG))
@@ -210,7 +205,7 @@ class GRASSStartup(wx.Frame):
     def _set_properties(self):
     def _set_properties(self):
         """!Set frame properties"""
         """!Set frame properties"""
         self.SetTitle(_("Welcome to GRASS GIS"))
         self.SetTitle(_("Welcome to GRASS GIS"))
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, "grass.ico"),
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, "grass.ico"),
                              wx.BITMAP_TYPE_ICO))
                              wx.BITMAP_TYPE_ICO))
 
 
         self.lwelcome.SetForegroundColour(wx.Colour(35, 142, 35))
         self.lwelcome.SetForegroundColour(wx.Colour(35, 142, 35))

+ 2 - 2
gui/wxpython/gmodeler/dialogs.py

@@ -151,7 +151,7 @@ class ModelSearchDialog(wx.Dialog):
         
         
         wx.Dialog.__init__(self, parent = parent, id = wx.ID_ANY, title = title, **kwargs)
         wx.Dialog.__init__(self, parent = parent, id = wx.ID_ANY, title = title, **kwargs)
         self.SetName("ModelerDialog")
         self.SetName("ModelerDialog")
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         
         
         self._command = None
         self._command = None
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
@@ -301,7 +301,7 @@ class ModelRelationDialog(wx.Dialog):
         
         
         self.valid = True
         self.valid = True
         wx.Dialog.__init__(self, parent, id, title, style = style, **kwargs)
         wx.Dialog.__init__(self, parent, id, title, style = style, **kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         
         
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         
         

+ 1 - 1
gui/wxpython/gmodeler/frame.py

@@ -83,7 +83,7 @@ class ModelFrame(wx.Frame):
         
         
         wx.Frame.__init__(self, parent = parent, id = id, title = title, **kwargs)
         wx.Frame.__init__(self, parent = parent, id = id, title = title, **kwargs)
         self.SetName("Modeler")
         self.SetName("Modeler")
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         
         
         self.menubar = Menu(parent = self, model = ModelerMenuData().GetModel(separators=True))        
         self.menubar = Menu(parent = self, model = ModelerMenuData().GetModel(separators=True))        
         self.SetMenuBar(self.menubar)
         self.SetMenuBar(self.menubar)

+ 0 - 5
gui/wxpython/gmodeler/g.gui.gmodeler.py

@@ -35,16 +35,11 @@
 #%end
 #%end
 
 
 import os
 import os
-import sys
 
 
 import  wx
 import  wx
 
 
 import grass.script as grass
 import grass.script as grass
 
 
-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.giface import StandaloneGrassInterface
 from core.globalvar import CheckWxVersion
 from core.globalvar import CheckWxVersion
 from core.utils import _, GuiModuleMain
 from core.utils import _, GuiModuleMain

+ 1 - 1
gui/wxpython/gmodeler/menudata.py

@@ -22,7 +22,7 @@ from core.menutree  import MenuTreeModelBuilder
 class ModelerMenuData(MenuTreeModelBuilder):
 class ModelerMenuData(MenuTreeModelBuilder):
     def __init__(self, filename = None):
     def __init__(self, filename = None):
         if not filename:
         if not filename:
-            filename = os.path.join(globalvar.ETCWXDIR, 'xml', 'menudata_modeler.xml')
+            filename = os.path.join(globalvar.WXGUIDIR, 'xml', 'menudata_modeler.xml')
         
         
         MenuTreeModelBuilder.__init__(self, filename)
         MenuTreeModelBuilder.__init__(self, filename)
 
 

+ 1 - 1
gui/wxpython/gmodeler/model.py

@@ -289,7 +289,7 @@ class Model(object):
         
         
         Raise exception on error.
         Raise exception on error.
         """
         """
-        dtdFilename = os.path.join(globalvar.ETCWXDIR, "xml", "grass-gxm.dtd")
+        dtdFilename = os.path.join(globalvar.WXGUIDIR, "xml", "grass-gxm.dtd")
         
         
         # parse workspace file
         # parse workspace file
         try:
         try:

+ 1 - 1
gui/wxpython/gui_core/dialogs.py

@@ -2399,7 +2399,7 @@ class SqlQueryFrame(wx.Frame):
         self.parent = parent
         self.parent = parent
 
 
         wx.Frame.__init__(self, parent = parent, id = id, title = title, *kwargs)
         wx.Frame.__init__(self, parent = parent, id = id, title = title, *kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_sql.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass_sql.ico'), wx.BITMAP_TYPE_ICO))
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         
         
         self.sqlBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
         self.sqlBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,

+ 10 - 16
gui/wxpython/gui_core/forms.py

@@ -58,18 +58,11 @@ import codecs
 
 
 from threading import Thread
 from threading import Thread
 
 
-gisbase = os.getenv("GISBASE")
-if gisbase is None:
-    print >>sys.stderr, "We don't seem to be properly installed, or we are being run outside GRASS. Expect glitches."
+if not os.getenv("GISBASE"):
+    sys.write("We don't seem to be properly installed, or we are being run "
+              "outside GRASS. Expect glitches.\n")
     gisbase = os.path.join(os.path.dirname(sys.argv[0]), os.path.pardir)
     gisbase = os.path.join(os.path.dirname(sys.argv[0]), os.path.pardir)
-    wxbase = gisbase
-else:
-    wxbase = os.path.join(gisbase, 'etc', 'gui', 'wxpython')
 
 
-if wxbase not in sys.path:
-    sys.path.append(wxbase)
-
-from core import globalvar
 import wx
 import wx
 try:
 try:
     import wx.lib.agw.flatnotebook as FN
     import wx.lib.agw.flatnotebook as FN
@@ -89,6 +82,7 @@ from grass.pydispatch.signal import Signal
 from grass.script import core as grass
 from grass.script import core as grass
 from grass.script import task as gtask
 from grass.script import task as gtask
 
 
+from core import globalvar
 from gui_core.widgets import StaticWrapText, ScrolledPanel, ColorTablesComboBox, \
 from gui_core.widgets import StaticWrapText, ScrolledPanel, ColorTablesComboBox, \
                              BarscalesComboBox, NArrowsComboBox
                              BarscalesComboBox, NArrowsComboBox
 from gui_core.ghelp   import HelpPanel
 from gui_core.ghelp   import HelpPanel
@@ -417,7 +411,7 @@ class TaskFrame(wx.Frame):
         self.CreateStatusBar()
         self.CreateStatusBar()
         
         
         # icon
         # icon
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_dialog.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass_dialog.ico'), wx.BITMAP_TYPE_ICO))
         
         
         guisizer = wx.BoxSizer(wx.VERTICAL)
         guisizer = wx.BoxSizer(wx.VERTICAL)
         
         
@@ -432,7 +426,7 @@ class TaskFrame(wx.Frame):
         
         
         # GRASS logo
         # GRASS logo
         self.logo = wx.StaticBitmap(parent = self.panel,
         self.logo = wx.StaticBitmap(parent = self.panel,
-                                    bitmap = wx.Bitmap(name = os.path.join(globalvar.ETCIMGDIR,
+                                    bitmap = wx.Bitmap(name = os.path.join(globalvar.IMGDIR,
                                                                            'grass_form.png'),
                                                                            'grass_form.png'),
                                                      type = wx.BITMAP_TYPE_PNG))
                                                      type = wx.BITMAP_TYPE_PNG))
         topsizer.Add(item = self.logo, proportion = 0, border = 3,
         topsizer.Add(item = self.logo, proportion = 0, border = 3,
@@ -1054,7 +1048,7 @@ class CmdPanel(wx.Panel):
                         value = self._getValue(p)
                         value = self._getValue(p)
                         
                         
                         if p['name'] == 'icon': # symbols
                         if p['name'] == 'icon': # symbols
-                            bitmap = wx.Bitmap(os.path.join(globalvar.ETCSYMBOLDIR, value) + '.png')
+                            bitmap = wx.Bitmap(os.path.join(globalvar.SYMBDIR, value) + '.png')
                             bb = wx.BitmapButton(parent = which_panel, id = wx.ID_ANY,
                             bb = wx.BitmapButton(parent = which_panel, id = wx.ID_ANY,
                                                  bitmap = bitmap)
                                                  bitmap = bitmap)
                             iconLabel = wx.StaticText(parent = which_panel, id = wx.ID_ANY)
                             iconLabel = wx.StaticText(parent = which_panel, id = wx.ID_ANY)
@@ -1268,7 +1262,7 @@ class CmdPanel(wx.Panel):
                             showButton = False
                             showButton = False
                         if showButton:
                         if showButton:
                             iconTheme = UserSettings.Get(group='appearance', key='iconTheme', subkey='type')
                             iconTheme = UserSettings.Get(group='appearance', key='iconTheme', subkey='type')
-                            bitmap = wx.Bitmap(os.path.join(globalvar.ETCICONDIR, iconTheme, 'map-info.png'))
+                            bitmap = wx.Bitmap(os.path.join(globalvar.ICONDIR, iconTheme, 'map-info.png'))
                             bb = wx.BitmapButton(parent=which_panel, bitmap=bitmap)
                             bb = wx.BitmapButton(parent=which_panel, bitmap=bitmap)
                             bb.Bind(wx.EVT_BUTTON, self.OnTimelineTool)
                             bb.Bind(wx.EVT_BUTTON, self.OnTimelineTool)
                             bb.SetToolTipString(_("Show graphical representation of temporal extent of dataset(s) ."))
                             bb.SetToolTipString(_("Show graphical representation of temporal extent of dataset(s) ."))
@@ -2147,7 +2141,7 @@ class CmdPanel(wx.Panel):
         for p in self.task.params:
         for p in self.task.params:
             if 'wxId' in p and myId in p['wxId']:
             if 'wxId' in p and myId in p['wxId']:
                 from gui_core.dialogs import SymbolDialog
                 from gui_core.dialogs import SymbolDialog
-                dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
+                dlg = SymbolDialog(self, symbolPath = globalvar.SYMBDIR,
                                    currentSymbol = p['value'])
                                    currentSymbol = p['value'])
                 if dlg.ShowModal() == wx.ID_OK:
                 if dlg.ShowModal() == wx.ID_OK:
                     img = dlg.GetSelectedSymbolPath()
                     img = dlg.GetSelectedSymbolPath()
@@ -2236,7 +2230,7 @@ class CmdPanel(wx.Panel):
         
         
     def AddBitmapToImageList(self, section, imageList):
     def AddBitmapToImageList(self, section, imageList):
         iconTheme = UserSettings.Get(group = 'appearance', key = 'iconTheme', subkey = 'type')
         iconTheme = UserSettings.Get(group = 'appearance', key = 'iconTheme', subkey = 'type')
-        iconSectionDict = {'manual': os.path.join(globalvar.ETCICONDIR, iconTheme, 'help.png')}
+        iconSectionDict = {'manual': os.path.join(globalvar.ICONDIR, iconTheme, 'help.png')}
         if section in iconSectionDict.keys():
         if section in iconSectionDict.keys():
             image = wx.Image(iconSectionDict[section]).Scale(16, 16, wx.IMAGE_QUALITY_HIGH)
             image = wx.Image(iconSectionDict[section]).Scale(16, 16, wx.IMAGE_QUALITY_HIGH)
             idx = imageList.Add(wx.BitmapFromImage(image))
             idx = imageList.Add(wx.BitmapFromImage(image))

+ 4 - 5
gui/wxpython/gui_core/ghelp.py

@@ -50,7 +50,7 @@ class AboutWindow(wx.Frame):
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         
         
         # icon
         # icon
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
 
 
         # notebook
         # notebook
         self.aboutNotebook = FormNotebook(self.panel, style = wx.BK_LEFT)
         self.aboutNotebook = FormNotebook(self.panel, style = wx.BK_LEFT)
@@ -104,7 +104,7 @@ class AboutWindow(wx.Frame):
         infoTxt.SetupScrolling()
         infoTxt.SetupScrolling()
         infoSizer = wx.BoxSizer(wx.VERTICAL)
         infoSizer = wx.BoxSizer(wx.VERTICAL)
         infoGridSizer = wx.GridBagSizer(vgap = 5, hgap = 5)
         infoGridSizer = wx.GridBagSizer(vgap = 5, hgap = 5)
-        logo = os.path.join(globalvar.ETCDIR, "gui", "icons", "grass-64x64.png")
+        logo = os.path.join(globalvar.ICONDIR, "grass-64x64.png")
         logoBitmap = wx.StaticBitmap(parent = infoTxt, id = wx.ID_ANY,
         logoBitmap = wx.StaticBitmap(parent = infoTxt, id = wx.ID_ANY,
                                      bitmap = wx.Bitmap(name = logo,
                                      bitmap = wx.Bitmap(name = logo,
                                                         type = wx.BITMAP_TYPE_PNG))
                                                         type = wx.BITMAP_TYPE_PNG))
@@ -429,8 +429,7 @@ class AboutWindow(wx.Frame):
                                                             label = email))
                                                             label = email))
                     translatorsBox.Add(item = wx.StaticText(parent = translatorswin, id = wx.ID_ANY,
                     translatorsBox.Add(item = wx.StaticText(parent = translatorswin, id = wx.ID_ANY,
                                                             label = lang))                                                            
                                                             label = lang))                                                            
-                    flag = os.path.join(os.getenv("GISBASE"), "etc", "gui", 
-                            "icons", "flags", "%s.png" % lang.lower())
+                    flag = os.path.join(globalvar.ICONDIR, "flags", "%s.png" % lang.lower())
                     if os.path.exists(flag):
                     if os.path.exists(flag):
                         flagBitmap = wx.StaticBitmap(parent = translatorswin, id = wx.ID_ANY,
                         flagBitmap = wx.StaticBitmap(parent = translatorswin, id = wx.ID_ANY,
                                      bitmap = wx.Bitmap(name = flag,
                                      bitmap = wx.Bitmap(name = flag,
@@ -794,7 +793,7 @@ def ShowAboutDialog(prgName, startYear):
     """
     """
     info = wx.AboutDialogInfo()
     info = wx.AboutDialogInfo()
     
     
-    info.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+    info.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
     info.SetName(prgName)
     info.SetName(prgName)
     info.SetWebSite('http://grass.osgeo.org')
     info.SetWebSite('http://grass.osgeo.org')
     info.SetDescription(_grassDevTeam(startYear) + '\n\n' +
     info.SetDescription(_grassDevTeam(startYear) + '\n\n' +

+ 0 - 5
gui/wxpython/gui_core/goutput.py

@@ -20,13 +20,8 @@ This program is free software under the GNU General Public License
 """
 """
 
 
 import os
 import os
-import sys
 import textwrap
 import textwrap
 
 
-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
 import wx
 from   wx import stc
 from   wx import stc
 
 

+ 1 - 1
gui/wxpython/gui_core/gselect.py

@@ -2147,7 +2147,7 @@ class CoordinatesSelect(wx.Panel):
                                        size=globalvar.DIALOG_TEXTCTRL_SIZE,
                                        size=globalvar.DIALOG_TEXTCTRL_SIZE,
                                        validator=CoordinatesValidator())
                                        validator=CoordinatesValidator())
         
         
-        icon = wx.Bitmap(os.path.join(globalvar.ETCICONDIR, "grass", "pointer.png"))
+        icon = wx.Bitmap(os.path.join(globalvar.ICONDIR, "grass", "pointer.png"))
         self.buttonInsCoords = buttons.ThemedGenBitmapToggleButton(parent=self, id=wx.ID_ANY,
         self.buttonInsCoords = buttons.ThemedGenBitmapToggleButton(parent=self, id=wx.ID_ANY,
                                                                    bitmap=icon,
                                                                    bitmap=icon,
                                                                    size=globalvar.DIALOG_COLOR_SIZE)
                                                                    size=globalvar.DIALOG_COLOR_SIZE)

+ 1 - 1
gui/wxpython/gui_core/mapdisp.py

@@ -83,7 +83,7 @@ class MapFrameBase(wx.Frame):
         self.SetClientSize(self.GetSize())
         self.SetClientSize(self.GetSize())
         self.iconsize = (16, 16)
         self.iconsize = (16, 16)
 
 
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_map.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass_map.ico'), wx.BITMAP_TYPE_ICO))
         
         
         # toolbars
         # toolbars
         self.toolbars = {}
         self.toolbars = {}

+ 2 - 2
gui/wxpython/gui_core/preferences.py

@@ -1032,7 +1032,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         self.winId['vectorLayer:point:symbol'] = symbolLabel.GetId()
         self.winId['vectorLayer:point:symbol'] = symbolLabel.GetId()
         gridSizer.Add(item = symbolLabel, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT, pos = (row, col + 1))
         gridSizer.Add(item = symbolLabel, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT, pos = (row, col + 1))
 
 
-        bitmap = wx.Bitmap(os.path.join(globalvar.ETCSYMBOLDIR, symbolPath) + '.png')
+        bitmap = wx.Bitmap(os.path.join(globalvar.SYMBDIR, symbolPath) + '.png')
         bb = wx.BitmapButton(parent = panel, id = wx.ID_ANY, bitmap = bitmap, name = "symbolButton")
         bb = wx.BitmapButton(parent = panel, id = wx.ID_ANY, bitmap = bitmap, name = "symbolButton")
         bb.Bind(wx.EVT_BUTTON, self.OnSetSymbol)
         bb.Bind(wx.EVT_BUTTON, self.OnSetSymbol)
         gridSizer.Add(item = bb, pos = (row, col + 2))
         gridSizer.Add(item = bb, pos = (row, col + 2))
@@ -1496,7 +1496,7 @@ class PreferencesDialog(PreferencesBaseDialog):
         winId = self.winId['vectorLayer:point:symbol']
         winId = self.winId['vectorLayer:point:symbol']
         label = self.FindWindowById(winId)
         label = self.FindWindowById(winId)
         bb = self.FindWindowByName('symbolButton')
         bb = self.FindWindowByName('symbolButton')
-        dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
+        dlg = SymbolDialog(self, symbolPath = globalvar.SYMBDIR,
                            currentSymbol = label.GetLabel())
                            currentSymbol = label.GetLabel())
         if dlg.ShowModal() == wx.ID_OK:
         if dlg.ShowModal() == wx.ID_OK:
             img = dlg.GetSelectedSymbolPath()
             img = dlg.GetSelectedSymbolPath()

+ 0 - 6
gui/wxpython/gui_core/query.py

@@ -14,14 +14,8 @@ This program is free software under the GNU General Public License
 @author Anna Kratochvilova <kratochanna gmail.com>
 @author Anna Kratochvilova <kratochanna gmail.com>
 """
 """
 import os
 import os
-import sys
 import wx
 import wx
 
 
-if __name__ == '__main__':
-    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.utils import _
 from core.utils import _
 from gui_core.treeview import TreeListView
 from gui_core.treeview import TreeListView
 from core.treemodel import TreeModel, DictNode
 from core.treemodel import TreeModel, DictNode

+ 0 - 6
gui/wxpython/gui_core/simplelmgr.py

@@ -16,13 +16,7 @@ This program is free software under the GNU General Public License
 @author Anna Petrasova (kratochanna gmail.com)
 @author Anna Petrasova (kratochanna gmail.com)
 """
 """
 import os
 import os
-import sys
 
 
-# adding a path to wxGUI modules
-if __name__ == '__main__':
-    WXGUIBASE = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
-    if WXGUIBASE not in sys.path:
-        sys.path.append(WXGUIBASE)
 import wx
 import wx
 import wx.aui
 import wx.aui
 
 

+ 2 - 2
gui/wxpython/gui_core/toolbars.py

@@ -26,7 +26,7 @@ from core.debug import Debug
 from core.utils import _
 from core.utils import _
 from icons.icon import MetaIcon
 from icons.icon import MetaIcon
 from collections import defaultdict
 from collections import defaultdict
-from core.globalvar import ETCIMGDIR
+from core.globalvar import IMGDIR
 
 
 from grass.pydispatch.signal import Signal
 from grass.pydispatch.signal import Signal
 
 
@@ -257,7 +257,7 @@ class BaseToolbar(wx.ToolBar):
 
 
         Button must be custom (not toolbar tool) to set smaller width.
         Button must be custom (not toolbar tool) to set smaller width.
         """
         """
-        arrowPath = os.path.join(ETCIMGDIR, 'small_down_arrow.png')
+        arrowPath = os.path.join(IMGDIR, 'small_down_arrow.png')
         if os.path.isfile(arrowPath) and os.path.getsize(arrowPath):
         if os.path.isfile(arrowPath) and os.path.getsize(arrowPath):
             bitmap = wx.Bitmap(name = arrowPath)
             bitmap = wx.Bitmap(name = arrowPath)
         else:
         else:

+ 1 - 6
gui/wxpython/gui_core/treeview.py

@@ -15,7 +15,7 @@ This program is free software under the GNU General Public License
 """
 """
 
 
 import os
 import os
-import sys
+
 import wx
 import wx
 from wx.lib.mixins.treemixin import VirtualTree, ExpansionState
 from wx.lib.mixins.treemixin import VirtualTree, ExpansionState
 try:
 try:
@@ -24,11 +24,6 @@ except ImportError:
     import wx.lib.customtreectrl as CT
     import wx.lib.customtreectrl as CT
 import wx.gizmos as gizmos
 import wx.gizmos as gizmos
 
 
-if __name__ == '__main__':
-    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.globalvar import hasAgw
 from core.treemodel import TreeModel, DictNode
 from core.treemodel import TreeModel, DictNode
 from core.utils import _
 from core.utils import _

+ 0 - 5
gui/wxpython/iclass/frame.py

@@ -24,11 +24,6 @@ import tempfile
 import types
 import types
 from core.utils import _
 from core.utils import _
 
 
-if __name__ == "__main__":
-    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 import globalvar
 import wx
 import wx
 
 

+ 0 - 6
gui/wxpython/iclass/g.gui.iclass.py

@@ -50,17 +50,11 @@
 #%end
 #%end
 
 
 import os
 import os
-import sys
 
 
 import  wx
 import  wx
 
 
 import grass.script as grass
 import grass.script as grass
 
 
-if __name__ == '__main__':
-    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.settings import UserSettings
 from core.globalvar import CheckWxVersion
 from core.globalvar import CheckWxVersion
 from core.giface import StandaloneGrassInterface
 from core.giface import StandaloneGrassInterface

+ 1 - 1
gui/wxpython/icons/grass_icons.py

@@ -9,7 +9,7 @@ import os
 
 
 from core import globalvar
 from core import globalvar
 
 
-iconPath = os.path.join(globalvar.ETCDIR, "gui", "icons", "grass")
+iconPath = os.path.join(globalvar.ICONDIR, "grass")
 
 
 iconSet = dict()
 iconSet = dict()
 
 

+ 1 - 1
gui/wxpython/icons/icon.py

@@ -6,7 +6,7 @@
 Classes:
 Classes:
  - MetaIcon
  - MetaIcon
 
 
-(C) 2007-2008, 2010-2011 by the GRASS Development Team
+(C) 2007-2014 by the GRASS Development Team
 
 
 This program is free software under the GNU General Public License
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
 (>=v2). Read the file COPYING that comes with GRASS for details.

+ 1 - 1
gui/wxpython/iscatt/frame.py

@@ -146,7 +146,7 @@ class IScattDialog(wx.Dialog):
     def __init__(self, parent, giface, title=_("GRASS GIS Interactive Scatter Plot Tool"),
     def __init__(self, parent, giface, title=_("GRASS GIS Interactive Scatter Plot Tool"),
                  id=wx.ID_ANY, style=wx.DEFAULT_FRAME_STYLE, **kwargs):
                  id=wx.ID_ANY, style=wx.DEFAULT_FRAME_STYLE, **kwargs):
         wx.Dialog.__init__(self, parent, id, style=style, title = title, **kwargs)
         wx.Dialog.__init__(self, parent, id, style=style, title = title, **kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
 
 
         self.iscatt_panel = MapDispIScattPanel(self, giface)
         self.iscatt_panel = MapDispIScattPanel(self, giface)
 
 

+ 1 - 4
gui/wxpython/lmgr/frame.py

@@ -110,7 +110,7 @@ class GMFrame(wx.Frame):
         self._setTitle()
         self._setTitle()
         self.SetName("LayerManager")
         self.SetName("LayerManager")
         
         
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         
         
         self._giface = LayerManagerGrassInterface(self)
         self._giface = LayerManagerGrassInterface(self)
         
         
@@ -1166,9 +1166,6 @@ class GMFrame(wx.Frame):
         @return True on success
         @return True on success
         @return False on error
         @return False on error
         """
         """
-        # dtd
-        # dtdFilename = os.path.join(globalvar.ETCWXDIR, "xml", "grass-gxw.dtd")
-        
         # parse workspace file
         # parse workspace file
         try:
         try:
             gxwXml = ProcessWorkspaceFile(etree.parse(filename))
             gxwXml = ProcessWorkspaceFile(etree.parse(filename))

+ 4 - 4
gui/wxpython/lmgr/menudata.py

@@ -19,7 +19,7 @@ import os
 
 
 from core.menutree  import MenuTreeModelBuilder
 from core.menutree  import MenuTreeModelBuilder
 from core.toolboxes import getMenudataFile
 from core.toolboxes import getMenudataFile
-from core.globalvar import ETCWXDIR
+from core.globalvar import WXGUIDIR
 from core.gcmd import GError
 from core.gcmd import GError
 from core.utils import _
 from core.utils import _
 
 
@@ -31,7 +31,7 @@ class LayerManagerMenuData(MenuTreeModelBuilder):
         else:
         else:
             expandAddons = True
             expandAddons = True
 
 
-        fallback = os.path.join(ETCWXDIR, 'xml', 'menudata.xml')
+        fallback = os.path.join(WXGUIDIR, 'xml', 'menudata.xml')
         if not filename:
         if not filename:
             filename = getMenudataFile(userRootFile='main_menu.xml',
             filename = getMenudataFile(userRootFile='main_menu.xml',
                                        newFile='menudata.xml',
                                        newFile='menudata.xml',
@@ -41,7 +41,7 @@ class LayerManagerMenuData(MenuTreeModelBuilder):
         except (ValueError, AttributeError, TypeError):
         except (ValueError, AttributeError, TypeError):
             GError(_("Unable to parse user toolboxes XML files. "
             GError(_("Unable to parse user toolboxes XML files. "
                      "Default main menu will be loaded."))
                      "Default main menu will be loaded."))
-            fallback = os.path.join(ETCWXDIR, 'xml', 'menudata.xml')
+            fallback = os.path.join(WXGUIDIR, 'xml', 'menudata.xml')
             MenuTreeModelBuilder.__init__(self, fallback)
             MenuTreeModelBuilder.__init__(self, fallback)
 
 
 
 
@@ -52,7 +52,7 @@ class LayerManagerModuleTree(MenuTreeModelBuilder):
         else:
         else:
             expandAddons = True
             expandAddons = True
 
 
-        fallback = os.path.join(ETCWXDIR, 'xml', 'module_tree_menudata.xml')
+        fallback = os.path.join(WXGUIDIR, 'xml', 'module_tree_menudata.xml')
         if not filename:
         if not filename:
             filename = getMenudataFile(userRootFile='module_tree.xml',
             filename = getMenudataFile(userRootFile='module_tree.xml',
                                        newFile='module_tree_menudata.xml',
                                        newFile='module_tree_menudata.xml',

+ 2 - 8
gui/wxpython/location_wizard/dialogs.py

@@ -18,16 +18,10 @@ This program is free software under the GNU General Public License
 @author Martin Landa <landa.martin gmail.com>   
 @author Martin Landa <landa.martin gmail.com>   
 """
 """
 import os
 import os
-import sys
 
 
 import wx
 import wx
 import wx.lib.scrolledpanel as scrolled
 import wx.lib.scrolledpanel as scrolled
 
 
-if __name__ == '__main__':
-    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                 import globalvar
 from core.gcmd            import RunCommand
 from core.gcmd            import RunCommand
 from core.utils import _
 from core.utils import _
@@ -43,7 +37,7 @@ class RegionDef(BaseClass, wx.Dialog):
         wx.Dialog.__init__(self, parent, id, title, size = size)
         wx.Dialog.__init__(self, parent, id, title, size = size)
         panel = wx.Panel(self, id = wx.ID_ANY)
         panel = wx.Panel(self, id = wx.ID_ANY)
         
         
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         
         
         self.parent = parent
         self.parent = parent
         self.location = location
         self.location = location
@@ -93,7 +87,7 @@ class RegionDef(BaseClass, wx.Dialog):
         #
         #
         # image
         # image
         #
         #
-        self.img = wx.Image(os.path.join(globalvar.ETCIMGDIR, "qgis_world.png"),
+        self.img = wx.Image(os.path.join(globalvar.IMGDIR, "qgis_world.png"),
                             wx.BITMAP_TYPE_PNG).ConvertToBitmap()
                             wx.BITMAP_TYPE_PNG).ConvertToBitmap()
         
         
         #
         #

+ 1 - 1
gui/wxpython/location_wizard/wizard.py

@@ -1809,7 +1809,7 @@ class LocationWizard(wx.Object):
         #
         #
         # define wizard image
         # define wizard image
         #
         #
-        imagePath = os.path.join(globalvar.ETCIMGDIR, "loc_wizard_qgis.png")
+        imagePath = os.path.join(globalvar.IMGDIR, "loc_wizard_qgis.png")
         wizbmp = wx.Image(imagePath, wx.BITMAP_TYPE_PNG)
         wizbmp = wx.Image(imagePath, wx.BITMAP_TYPE_PNG)
         wizbmp = wizbmp.ConvertToBitmap()
         wizbmp = wizbmp.ConvertToBitmap()
         
         

+ 0 - 5
gui/wxpython/mapdisp/frame.py

@@ -30,11 +30,6 @@ from core import globalvar
 import wx
 import wx
 import wx.aui
 import wx.aui
 
 
-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               import globalvar
 from core.render        import Map
 from core.render        import Map
 from vdigit.toolbars    import VDigitToolbar
 from vdigit.toolbars    import VDigitToolbar

+ 0 - 5
gui/wxpython/mapdisp/main.py

@@ -29,11 +29,6 @@ This program is free software under the GNU General Public License
 import os
 import os
 import sys
 import sys
 
 
-if __name__ == "__main__":
-    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          import globalvar
 import wx
 import wx
 
 

+ 0 - 6
gui/wxpython/mapdisp/test_mapdisp.py

@@ -55,12 +55,6 @@ import wx
 
 
 import grass.script as grass
 import grass.script as grass
 
 
-# adding a path to wxGUI modules
-if __name__ == '__main__':
-    WXGUIBASE = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
-    if WXGUIBASE not in sys.path:
-        sys.path.append(WXGUIBASE)
-
 from core.utils import _
 from core.utils import _
 from core.settings import UserSettings
 from core.settings import UserSettings
 from core.globalvar import CheckWxVersion
 from core.globalvar import CheckWxVersion

+ 0 - 6
gui/wxpython/mapswipe/g.gui.mapswipe.py

@@ -46,17 +46,11 @@
 
 
 
 
 import os
 import os
-import sys
 
 
 import  wx
 import  wx
 
 
 import grass.script as grass
 import grass.script as grass
 
 
-if __name__ == '__main__':
-    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.settings import UserSettings
 from core.globalvar import CheckWxVersion
 from core.globalvar import CheckWxVersion
 from core.giface import StandaloneGrassInterface
 from core.giface import StandaloneGrassInterface

+ 1 - 1
gui/wxpython/modules/colorrules.py

@@ -327,7 +327,7 @@ class ColorTable(wx.Frame):
         
         
         wx.Frame.__init__(self, parent, id, title, style = style, **kwargs)
         wx.Frame.__init__(self, parent, id, title, style = style, **kwargs)
         
         
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         
         
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         
         

+ 2 - 2
gui/wxpython/modules/extensions.py

@@ -42,7 +42,7 @@ class InstallExtensionWindow(wx.Frame):
         self.options = dict() # list of options
         self.options = dict() # list of options
 
 
         wx.Frame.__init__(self, parent = parent, id = id, title = title, **kwargs)
         wx.Frame.__init__(self, parent = parent, id = id, title = title, **kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         
         
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
 
 
@@ -354,7 +354,7 @@ class ManageExtensionWindow(wx.Frame):
         self.parent = parent
         self.parent = parent
         
         
         wx.Frame.__init__(self, parent = parent, id = id, title = title, **kwargs)
         wx.Frame.__init__(self, parent = parent, id = id, title = title, **kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         
         
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
 
 

+ 1 - 1
gui/wxpython/modules/histogram.py

@@ -270,7 +270,7 @@ class HistogramFrame(wx.Frame):
                  size = wx.Size(500, 350),
                  size = wx.Size(500, 350),
                  style = wx.DEFAULT_FRAME_STYLE, **kwargs):
                  style = wx.DEFAULT_FRAME_STYLE, **kwargs):
         wx.Frame.__init__(self, parent, id, title, size = size, style = style, **kwargs)
         wx.Frame.__init__(self, parent, id, title, size = size, style = style, **kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
 
 
         self._giface = giface
         self._giface = giface
         self.Map   = Map()         # instance of render.Map to be associated with display
         self.Map   = Map()         # instance of render.Map to be associated with display

+ 33 - 0
gui/wxpython/modules/mapsets_picker.py

@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+
+import os
+import sys
+import pwd
+
+from grass.script import core as grass
+
+import wx
+import wx.lib.mixins.listctrl as listmix
+
+from core.gcmd import RunCommand 
+from core.utils import _, GuiModuleMain
+from gui_core.preferences import MapsetAccess
+
+def main():
+    app = wx.App()
+
+    dlg = MapsetAccess(parent = None)
+    dlg.CenterOnScreen()
+        
+    if dlg.ShowModal() == wx.ID_OK:
+        ms = dlg.GetMapsets()
+        RunCommand('g.mapsets',
+                   parent = None,
+                   mapset = '%s' % ','.join(ms),
+                   operation = 'set')
+    
+    app.MainLoop()
+
+if __name__ == "__main__":
+    GuiModuleMain(main)
+

+ 1 - 7
gui/wxpython/modules/mcalc_builder.py

@@ -17,17 +17,11 @@ This program is free software under the GNU General Public License
 """
 """
 
 
 import os
 import os
-import sys
 import re
 import re
 
 
 import wx
 import wx
 import grass.script as grass
 import grass.script as grass
 
 
-if __name__ == "__main__":
-    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             import globalvar
 from core.gcmd        import GError, RunCommand
 from core.gcmd        import GError, RunCommand
 from core.giface      import StandaloneGrassInterface
 from core.giface      import StandaloneGrassInterface
@@ -61,7 +55,7 @@ class MapCalcFrame(wx.Frame):
             title = _('GRASS GIS 3D Raster Map Calculator')
             title = _('GRASS GIS 3D Raster Map Calculator')
             
             
         wx.Frame.__init__(self, parent, id = id, title = title, **kwargs)
         wx.Frame.__init__(self, parent, id = id, title = title, **kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         
         
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.CreateStatusBar()
         self.CreateStatusBar()

+ 1 - 7
gui/wxpython/modules/vclean.py

@@ -15,16 +15,10 @@ This program is free software under the GNU General Public License
 """
 """
 
 
 import os
 import os
-import sys
 
 
 import wx
 import wx
 import wx.lib.scrolledpanel as scrolled
 import wx.lib.scrolledpanel as scrolled
 
 
-if __name__ == '__main__':
-    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.gcmd        import RunCommand, GError
 from core             import globalvar
 from core             import globalvar
 from core.utils import _
 from core.utils import _
@@ -55,7 +49,7 @@ class VectorCleaningFrame(wx.Frame):
         self.CreateStatusBar()
         self.CreateStatusBar()
 
 
         # icon
         # icon
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
 
 
         self.panel = wx.Panel(parent=self, id=wx.ID_ANY)
         self.panel = wx.Panel(parent=self, id=wx.ID_ANY)
 
 

+ 1 - 1
gui/wxpython/nviz/preferences.py

@@ -33,7 +33,7 @@ class NvizPreferencesDialog(PreferencesBaseDialog):
                  settings = UserSettings):
                  settings = UserSettings):
         PreferencesBaseDialog.__init__(self, parent = parent, title = title, giface = giface,
         PreferencesBaseDialog.__init__(self, parent = parent, title = title, giface = giface,
                                        settings = settings)
                                        settings = settings)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_nviz.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass_nviz.ico'), wx.BITMAP_TYPE_ICO))
 
 
         self.toolWin = self.parent.nviz
         self.toolWin = self.parent.nviz
         
         

+ 5 - 5
gui/wxpython/psmap/dialogs.py

@@ -1960,7 +1960,7 @@ class VPropertiesDialog(PsmapDialog):
             
             
         self.symbolName = wx.StaticText(panel, id = wx.ID_ANY)
         self.symbolName = wx.StaticText(panel, id = wx.ID_ANY)
         self.symbolName.SetLabel(self.vPropertiesDict['symbol'])
         self.symbolName.SetLabel(self.vPropertiesDict['symbol'])
-        bitmap = wx.Bitmap(os.path.join(globalvar.ETCSYMBOLDIR,
+        bitmap = wx.Bitmap(os.path.join(globalvar.SYMBDIR,
                                         self.vPropertiesDict['symbol']) + '.png')
                                         self.vPropertiesDict['symbol']) + '.png')
         self.symbolButton = wx.BitmapButton(panel, id = wx.ID_ANY, bitmap = bitmap)
         self.symbolButton = wx.BitmapButton(panel, id = wx.ID_ANY, bitmap = bitmap)
             
             
@@ -2258,7 +2258,7 @@ class VPropertiesDialog(PsmapDialog):
         self.epsFileCtrl.Enable(not useSymbol)
         self.epsFileCtrl.Enable(not useSymbol)
             
             
     def OnSymbolSelection(self, event):
     def OnSymbolSelection(self, event):
-        dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
+        dlg = SymbolDialog(self, symbolPath = globalvar.SYMBDIR,
                            currentSymbol = self.symbolName.GetLabel())
                            currentSymbol = self.symbolName.GetLabel())
         if dlg.ShowModal() == wx.ID_OK:
         if dlg.ShowModal() == wx.ID_OK:
             img = dlg.GetSelectedSymbolPath()
             img = dlg.GetSelectedSymbolPath()
@@ -3529,7 +3529,7 @@ class ScalebarDialog(PsmapDialog):
         sbTypeText = wx.StaticText(panel, id = wx.ID_ANY, label = _("Type:"))
         sbTypeText = wx.StaticText(panel, id = wx.ID_ANY, label = _("Type:"))
         self.sbCombo = wx.combo.BitmapComboBox(panel, style = wx.CB_READONLY)
         self.sbCombo = wx.combo.BitmapComboBox(panel, style = wx.CB_READONLY)
         # only temporary, images must be moved away
         # only temporary, images must be moved away
-        imagePath = os.path.join(globalvar.ETCIMGDIR, "scalebar-fancy.png"), os.path.join(globalvar.ETCIMGDIR, "scalebar-simple.png") 
+        imagePath = os.path.join(globalvar.IMGDIR, "scalebar-fancy.png"), os.path.join(globalvar.IMGDIR, "scalebar-simple.png") 
         for item, path in zip(['fancy', 'simple'], imagePath):
         for item, path in zip(['fancy', 'simple'], imagePath):
             if not os.path.exists(path):
             if not os.path.exists(path):
                 bitmap = wx.EmptyBitmap(0,0)
                 bitmap = wx.EmptyBitmap(0,0)
@@ -4573,7 +4573,7 @@ class PointDialog(PsmapDialog):
                                           label = self.pointDict['symbol'])
                                           label = self.pointDict['symbol'])
         gridSizer.Add(item = self.symbolLabel, pos = (0, 1),
         gridSizer.Add(item = self.symbolLabel, pos = (0, 1),
                       flag = wx.ALIGN_CENTER_VERTICAL )
                       flag = wx.ALIGN_CENTER_VERTICAL )
-        bitmap = wx.Bitmap(os.path.join(globalvar.ETCSYMBOLDIR,
+        bitmap = wx.Bitmap(os.path.join(globalvar.SYMBDIR,
                                         self.pointDict['symbol']) + '.png')
                                         self.pointDict['symbol']) + '.png')
         self.symbolButton = wx.BitmapButton(panel, id = wx.ID_ANY, bitmap = bitmap)
         self.symbolButton = wx.BitmapButton(panel, id = wx.ID_ANY, bitmap = bitmap)
         self.symbolButton.Bind(wx.EVT_BUTTON, self.OnSymbolSelection)
         self.symbolButton.Bind(wx.EVT_BUTTON, self.OnSymbolSelection)
@@ -4715,7 +4715,7 @@ class PointDialog(PsmapDialog):
                 widget.GetWindow().Disable()
                 widget.GetWindow().Disable()
                 
                 
     def OnSymbolSelection(self, event):
     def OnSymbolSelection(self, event):
-        dlg = SymbolDialog(self, symbolPath = globalvar.ETCSYMBOLDIR,
+        dlg = SymbolDialog(self, symbolPath = globalvar.SYMBDIR,
                            currentSymbol = self.symbolLabel.GetLabel())
                            currentSymbol = self.symbolLabel.GetLabel())
         if dlg.ShowModal() == wx.ID_OK:
         if dlg.ShowModal() == wx.ID_OK:
             img = dlg.GetSelectedSymbolPath()
             img = dlg.GetSelectedSymbolPath()

+ 1 - 1
gui/wxpython/psmap/frame.py

@@ -60,7 +60,7 @@ class PsMapFrame(wx.Frame):
         self.parent = parent
         self.parent = parent
 
 
         wx.Frame.__init__(self, parent = parent, id = id, title = title, name = "PsMap", **kwargs)
         wx.Frame.__init__(self, parent = parent, id = id, title = title, name = "PsMap", **kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         #menubar
         #menubar
         self.menubar = Menu(parent = self, model = PsMapMenuData().GetModel(separators=True))
         self.menubar = Menu(parent = self, model = PsMapMenuData().GetModel(separators=True))
         self.SetMenuBar(self.menubar)
         self.SetMenuBar(self.menubar)

+ 0 - 5
gui/wxpython/psmap/g.gui.psmap.py

@@ -33,16 +33,11 @@
 #%end
 #%end
 
 
 import os
 import os
-import sys
 
 
 import  wx
 import  wx
 
 
 import grass.script as grass
 import grass.script as grass
 
 
-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 core.globalvar import CheckWxVersion
 from core.utils import _, GuiModuleMain
 from core.utils import _, GuiModuleMain
 from psmap.frame import PsMapFrame
 from psmap.frame import PsMapFrame

+ 1 - 1
gui/wxpython/psmap/menudata.py

@@ -26,6 +26,6 @@ class PsMapMenuData(MenuTreeModelBuilder):
         @param path path to XML to be read (None for menudata_psmap.xml)
         @param path path to XML to be read (None for menudata_psmap.xml)
         """
         """
         if not path:
         if not path:
-            path = os.path.join(globalvar.ETCWXDIR, 'xml', 'menudata_psmap.xml')
+            path = os.path.join(globalvar.WXGUIDIR, 'xml', 'menudata_psmap.xml')
         
         
         MenuTreeModelBuilder.__init__(self, path)
         MenuTreeModelBuilder.__init__(self, path)

+ 2 - 2
gui/wxpython/rlisetup/frame.py

@@ -28,7 +28,7 @@ class ViewFrame(wx.Frame):
         self.pathfile = os.path.join(self.rlipath, conf)
         self.pathfile = os.path.join(self.rlipath, conf)
         wx.Frame.__init__(self, parent=parent, id=id, title=title,
         wx.Frame.__init__(self, parent=parent, id=id, title=title,
                           **kwargs)
                           **kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'),
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'),
                              wx.BITMAP_TYPE_ICO))
                              wx.BITMAP_TYPE_ICO))
         self.panel = wx.Panel(parent=self, id=wx.ID_ANY)
         self.panel = wx.Panel(parent=self, id=wx.ID_ANY)
         self.confilesBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY,
         self.confilesBox = wx.StaticBox(parent=self.panel, id=wx.ID_ANY,
@@ -114,7 +114,7 @@ class RLiSetupFrame(wx.Frame):
         #init of frame
         #init of frame
         wx.Frame.__init__(self, parent=parent, id=id, title=title,
         wx.Frame.__init__(self, parent=parent, id=id, title=title,
                           **kwargs)
                           **kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'),
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'),
                              wx.BITMAP_TYPE_ICO))
                              wx.BITMAP_TYPE_ICO))
         self.panel = wx.Panel(parent=self, id=wx.ID_ANY)
         self.panel = wx.Panel(parent=self, id=wx.ID_ANY)
         #box for select configuration file
         #box for select configuration file

+ 0 - 5
gui/wxpython/rlisetup/g.gui.rlisetup.py

@@ -27,15 +27,10 @@
 #%end
 #%end
 
 
 import os
 import os
-import sys
 
 
 import wx
 import wx
 import grass.script as grass
 import grass.script as grass
 
 
-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.giface import StandaloneGrassInterface
 from core.globalvar import CheckWxVersion
 from core.globalvar import CheckWxVersion
 from core.utils import _, GuiModuleMain
 from core.utils import _, GuiModuleMain

+ 1 - 9
gui/wxpython/rlisetup/sampling_frame.py

@@ -18,7 +18,7 @@ This program is free software under the GNU General Public License
 """
 """
 
 
 import os
 import os
-import sys
+
 import wx
 import wx
 import wx.aui
 import wx.aui
 
 
@@ -36,14 +36,6 @@ try:
 except ImportError:
 except ImportError:
     pass
     pass
 
 
-#end new import
-
-# adding a path to wxGUI modules
-if __name__ == '__main__':
-    WXGUIBASE = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
-    if WXGUIBASE not in sys.path:
-        sys.path.append(WXGUIBASE)
-
 from core.utils import _
 from core.utils import _
 from core.giface import StandaloneGrassInterface
 from core.giface import StandaloneGrassInterface
 from mapwin.base import MapWindowProperties
 from mapwin.base import MapWindowProperties

+ 0 - 5
gui/wxpython/rlisetup/wizard.py

@@ -20,13 +20,8 @@ This program is free software under the GNU General Public License
 @author Luca Delucchi <lucadeluge gmail com>
 @author Luca Delucchi <lucadeluge gmail com>
 """
 """
 
 
-import sys
 import os
 import os
 
 
-wxbase = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
-if wxbase not in sys.path:
-    sys.path.append(wxbase)
-
 import wx
 import wx
 import wx.wizard as wiz
 import wx.wizard as wiz
 import wx.lib.scrolledpanel as scrolled
 import wx.lib.scrolledpanel as scrolled

+ 4 - 8
gui/wxpython/scripts/vkrige.py

@@ -23,17 +23,13 @@ import time
 import thread
 import thread
 from core.utils import _
 from core.utils import _
 
 
-### dependencies to be checked once, as they are quite time-consuming. cfr. grass.parser.
-# GRASS binding
+### dependencies to be checked once, as they are quite
+### time-consuming. cfr. grass.parser.
+
 try:
 try:
     import grass.script as grass
     import grass.script as grass
 except ImportError:
 except ImportError:
     sys.exit(_("No GRASS-python library found."))
     sys.exit(_("No GRASS-python library found."))
-### wxGUI imports
-
-GUIModulesPath = os.path.join(os.getenv("GISBASE"), "etc", "gui", "wxpython")
-if GUIModulesPath not in sys.path:
-    sys.path.append(GUIModulesPath)
 
 
 from core import globalvar
 from core import globalvar
 from gui_core import gselect
 from gui_core import gselect
@@ -278,7 +274,7 @@ class KrigingModule(wx.Frame):
         wx.Frame.__init__(self, parent, *args, **kwargs)
         wx.Frame.__init__(self, parent, *args, **kwargs)
         # setting properties and all widgettery
         # setting properties and all widgettery
         self.SetTitle(_("Kriging Module"))
         self.SetTitle(_("Kriging Module"))
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass_dialog.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass_dialog.ico'), wx.BITMAP_TYPE_ICO))
         self.log = Log(self) 
         self.log = Log(self) 
         self.CreateStatusBar()
         self.CreateStatusBar()
         self.log.message(_("Ready."))
         self.log.message(_("Ready."))

+ 2 - 5
gui/wxpython/timeline/frame.py

@@ -16,13 +16,13 @@ This program is free software under the GNU General Public License
 @author Anna Kratochvilova <kratochanna gmail.com>
 @author Anna Kratochvilova <kratochanna gmail.com>
 """
 """
 import os
 import os
-import sys
-import wx
 import signal
 import signal
 from math import ceil
 from math import ceil
 from itertools import cycle
 from itertools import cycle
 import numpy as np
 import numpy as np
 
 
+import wx
+
 try:
 try:
     import matplotlib
     import matplotlib
     # The recommended way to use wx with mpl is with the WXAgg
     # The recommended way to use wx with mpl is with the WXAgg
@@ -37,9 +37,6 @@ try:
 except ImportError:
 except ImportError:
     raise ImportError(_('The Timeline Tool needs "Matplotlib" package to be installed.'))
     raise ImportError(_('The Timeline Tool needs "Matplotlib" package to be installed.'))
 
 
-if __name__ == '__main__':
-    sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
-
 import grass.script as grass
 import grass.script as grass
 from core.utils import _
 from core.utils import _
 
 

+ 1 - 5
gui/wxpython/timeline/g.gui.timeline.py

@@ -35,12 +35,8 @@
 
 
 
 
 import os
 import os
-import sys
-import  wx
 
 
-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
 
 
 import grass.script as grass
 import grass.script as grass
 from core.utils import _, GuiModuleMain
 from core.utils import _, GuiModuleMain

+ 0 - 2
gui/wxpython/tools/update_menudata.py

@@ -30,8 +30,6 @@ except ImportError:
 from grass.script import core as grass
 from grass.script import core as grass
 from grass.script import task as gtask
 from grass.script import task as gtask
 
 
-if __name__ == "__main__":
-    sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
 from lmgr.menudata  import LayerManagerMenuData
 from lmgr.menudata  import LayerManagerMenuData
 from core.globalvar import grassCmd
 from core.globalvar import grassCmd
 
 

+ 0 - 6
gui/wxpython/vdigit/g.gui.vdigit.py

@@ -35,17 +35,11 @@
 #%end
 #%end
 
 
 import os
 import os
-import sys
 
 
 import grass.script as grass
 import grass.script as grass
 
 
 import wx
 import wx
 
 
-if __name__ == '__main__':
-    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 core.globalvar import CheckWxVersion
 from core.utils import _, GuiModuleMain
 from core.utils import _, GuiModuleMain
 from mapdisp.frame import MapFrame
 from mapdisp.frame import MapFrame

+ 2 - 1
gui/wxpython/vdigit/toolbars.py

@@ -42,7 +42,8 @@ class VDigitToolbar(BaseToolbar):
         BaseToolbar.__init__(self, parent, toolSwitcher)
         BaseToolbar.__init__(self, parent, toolSwitcher)
         self.digit         = None
         self.digit         = None
         self._giface       = giface
         self._giface       = giface
-        
+        self.fType         = None     # feature type for simple features editing
+
         self.editingStarted = Signal("VDigitToolbar.editingStarted")
         self.editingStarted = Signal("VDigitToolbar.editingStarted")
         self.editingStopped = Signal("VDigitToolbar.editingStopped")
         self.editingStopped = Signal("VDigitToolbar.editingStopped")
         self.editingBgMap = Signal("VDigitToolbar.editingBgMap")
         self.editingBgMap = Signal("VDigitToolbar.editingBgMap")

+ 2 - 2
gui/wxpython/vnet/dialogs.py

@@ -69,7 +69,7 @@ class VNETDialog(wx.Dialog):
         """!Dialog for vector network analysis"""
         """!Dialog for vector network analysis"""
 
 
         wx.Dialog.__init__(self, parent, id, style=style, title = title, **kwargs)
         wx.Dialog.__init__(self, parent, id, style=style, title = title, **kwargs)
-        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
 
 
         self.parent  = parent
         self.parent  = parent
         self.mapWin = giface.GetMapWindow()
         self.mapWin = giface.GetMapWindow()
@@ -341,7 +341,7 @@ class VNETDialog(wx.Dialog):
                 self.inputData[dataSel[0]] = dataSel[2](parent = selPanels[dataSel[0]],
                 self.inputData[dataSel[0]] = dataSel[2](parent = selPanels[dataSel[0]],
                                                         size = (-1, -1), 
                                                         size = (-1, -1), 
                                                         type = 'vector')
                                                         type = 'vector')
-                icon = wx.Image(os.path.join(globalvar.ETCICONDIR, "grass", "layer-vector-add.png"))
+                icon = wx.Image(os.path.join(globalvar.ICONDIR, "grass", "layer-vector-add.png"))
                 icon.Rescale(18, 18)
                 icon.Rescale(18, 18)
                 icon = wx.BitmapFromImage(icon) 
                 icon = wx.BitmapFromImage(icon) 
                 self.addToTreeBtn = wx.BitmapButton(parent = selPanels[dataSel[0]], 
                 self.addToTreeBtn = wx.BitmapButton(parent = selPanels[dataSel[0]], 

+ 2 - 2
gui/wxpython/vnet/widgets.py

@@ -410,7 +410,7 @@ class PointsList(wx.ListCtrl,
 
 
     def getSmallUpArrowImage(self):
     def getSmallUpArrowImage(self):
         """!Get arrow up symbol for indication of sorting"""
         """!Get arrow up symbol for indication of sorting"""
-        stream = open(os.path.join(globalvar.ETCIMGDIR, 'small_up_arrow.png'), 'rb')
+        stream = open(os.path.join(globalvar.IMGDIR, 'small_up_arrow.png'), 'rb')
         try:
         try:
             img = wx.ImageFromStream(stream)
             img = wx.ImageFromStream(stream)
         finally:
         finally:
@@ -419,7 +419,7 @@ class PointsList(wx.ListCtrl,
 
 
     def getSmallDnArrowImage(self):
     def getSmallDnArrowImage(self):
         """!Get arrow down symbol for indication of sorting"""
         """!Get arrow down symbol for indication of sorting"""
-        stream = open(os.path.join(globalvar.ETCIMGDIR, 'small_down_arrow.png'), 'rb')
+        stream = open(os.path.join(globalvar.IMGDIR, 'small_down_arrow.png'), 'rb')
         try:
         try:
             img = wx.ImageFromStream(stream)
             img = wx.ImageFromStream(stream)
         finally:
         finally:

+ 1 - 6
gui/wxpython/wxgui.py

@@ -22,11 +22,6 @@ import os
 import sys
 import sys
 import getopt
 import getopt
 
 
-if __name__ == "__main__":
-    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 import globalvar
 from core.utils import _
 from core.utils import _
 
 
@@ -60,7 +55,7 @@ class GMApp(wx.App):
             wx.InitAllImageHandlers()
             wx.InitAllImageHandlers()
         
         
         # create splash screen
         # create splash screen
-        introImagePath = os.path.join(globalvar.ETCIMGDIR, "silesia_splash.png")
+        introImagePath = os.path.join(globalvar.IMGDIR, "silesia_splash.png")
         introImage     = wx.Image(introImagePath, wx.BITMAP_TYPE_PNG)
         introImage     = wx.Image(introImagePath, wx.BITMAP_TYPE_PNG)
         introBmp       = introImage.ConvertToBitmap()
         introBmp       = introImage.ConvertToBitmap()
         if SC and sys.platform != 'darwin':
         if SC and sys.platform != 'darwin':

+ 2 - 2
gui/wxpython/wxplot/base.py

@@ -24,7 +24,7 @@ try:
 except ImportError, e:
 except ImportError, e:
     print >> sys.stderr, e
     print >> sys.stderr, e
 
 
-from core.globalvar    import ETCICONDIR
+from core.globalvar    import ICONDIR
 from core.settings     import UserSettings
 from core.settings     import UserSettings
 from wxplot.dialogs    import TextDialog, OptDialog
 from wxplot.dialogs    import TextDialog, OptDialog
 from core.render       import Map
 from core.render       import Map
@@ -73,7 +73,7 @@ class BasePlotFrame(wx.Frame):
         #
         #
         # Icon
         # Icon
         #
         #
-        self.SetIcon(wx.Icon(os.path.join(ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+        self.SetIcon(wx.Icon(os.path.join(ICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
                 
                 
         #
         #
         # Add statusbar
         # Add statusbar

+ 8 - 3
gui/xml/Makefile

@@ -2,7 +2,12 @@ MODULE_TOPDIR = ../..
 
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 
 
-default: $(ETC)/grass-interface.dtd 
+DSTDIR = $(GUIDIR)/xml
 
 
-$/$(ETC)/grass-interface.dtd : grass-interface.dtd 
-	$(INSTALL_DATA) grass-interface.dtd $(ETC)/grass-interface.dtd 
+default: $(DSTDIR)/grass-interface.dtd 
+
+$(DSTDIR)/grass-interface.dtd : grass-interface.dtd | $(DSTDIR)
+	$(INSTALL_DATA) $< $@
+
+$(DSTDIR):
+	-test -d $@ | $(MKDIR) $@

+ 2 - 1
include/Make/Grass.make

@@ -51,10 +51,11 @@ RUN_GISRC       = $(GISBASE)/demolocation/.grassrc$(GRASS_VERSION_MAJOR)$(GRASS_
 # or files used by GRASS programs
 # or files used by GRASS programs
 
 
 BIN             = $(ARCH_DISTDIR)/bin
 BIN             = $(ARCH_DISTDIR)/bin
-ETC             = $(ARCH_DISTDIR)/etc
 DRIVERDIR       = $(ARCH_DISTDIR)/driver
 DRIVERDIR       = $(ARCH_DISTDIR)/driver
 DBDRIVERDIR     = $(ARCH_DISTDIR)/driver/db
 DBDRIVERDIR     = $(ARCH_DISTDIR)/driver/db
 DOCSDIR         = $(ARCH_DISTDIR)/docs
 DOCSDIR         = $(ARCH_DISTDIR)/docs
+ETC             = $(ARCH_DISTDIR)/etc
+GUIDIR          = $(ARCH_DISTDIR)/gui
 HTMLDIR         = $(ARCH_DISTDIR)/docs/html
 HTMLDIR         = $(ARCH_DISTDIR)/docs/html
 SCRIPTDIR       = $(ARCH_DISTDIR)/scripts
 SCRIPTDIR       = $(ARCH_DISTDIR)/scripts
 MSG_DIR         = $(ARCH_DISTDIR)/etc/msgs
 MSG_DIR         = $(ARCH_DISTDIR)/etc/msgs

+ 4 - 2
include/Make/Rules.make

@@ -27,8 +27,10 @@ else
 mkpath = $(1):$(2)
 mkpath = $(1):$(2)
 endif
 endif
 
 
-GRASS_PYTHONPATH := $(call mkpath,$(GISBASE)/etc/python,$$PYTHONPATH)
-GRASS_PYTHONPATH := $(call mkpath,$(ARCH_DISTDIR)/etc/python,$(GRASS_PYTHONPATH))
+GRASS_PYTHONPATH := $(call mkpath,$(GISBASE)/gui/wxpython,$$PYTHONPATH)
+GRASS_PYTHONPATH := $(call mkpath,$(GISBASE)/etc/python,$(GRASS_PYTHONPATH))
+### really needed ???
+### GRASS_PYTHONPATH := $(call mkpath,$(ARCH_DISTDIR)/etc/python,$(GRASS_PYTHONPATH))
 
 
 run_grass = \
 run_grass = \
 	GISRC=$(RUN_GISRC) \
 	GISRC=$(RUN_GISRC) \

+ 1 - 1
lib/gis/parser.c

@@ -805,7 +805,7 @@ static void module_gui_wx(void)
     if (!st->pgm_path)
     if (!st->pgm_path)
 	G_fatal_error(_("Unable to determine program name"));
 	G_fatal_error(_("Unable to determine program name"));
 
 
-    sprintf(script, "%s/etc/gui/wxpython/gui_core/forms.py",
+    sprintf(script, "%s/gui/wxpython/gui_core/forms.py",
 	    getenv("GISBASE"));
 	    getenv("GISBASE"));
     G_spawn(getenv("GRASS_PYTHON"), getenv("GRASS_PYTHON"), script, G_recreate_command(), NULL);
     G_spawn(getenv("GRASS_PYTHON"), getenv("GRASS_PYTHON"), script, G_recreate_command(), NULL);
 }
 }

+ 9 - 9
lib/init/grass.py

@@ -17,7 +17,7 @@
 #               command line options for setting the GISDBASE, LOCATION,
 #               command line options for setting the GISDBASE, LOCATION,
 #               and/or MAPSET. Finally it starts GRASS with the appropriate
 #               and/or MAPSET. Finally it starts GRASS with the appropriate
 #               user interface and cleans up after it is finished.
 #               user interface and cleans up after it is finished.
-# COPYRIGHT:    (C) 2000-2013 by the GRASS Development Team
+# COPYRIGHT:    (C) 2000-2014 by the GRASS Development Team
 #
 #
 #               This program is free software under the GNU General
 #               This program is free software under the GNU General
 #               Public License (>=v2). Read the file COPYING that
 #               Public License (>=v2). Read the file COPYING that
@@ -381,13 +381,16 @@ def set_paths():
         os.environ['GRASS_ADDON_BASE'] = addon_base
         os.environ['GRASS_ADDON_BASE'] = addon_base
     path_prepend(os.path.join(addon_base, 'scripts'), 'PATH')
     path_prepend(os.path.join(addon_base, 'scripts'), 'PATH')
     path_prepend(os.path.join(addon_base, 'bin'), 'PATH')
     path_prepend(os.path.join(addon_base, 'bin'), 'PATH')
-
+    
     # standard installation
     # standard installation
     path_prepend(gfile('scripts'), 'PATH')
     path_prepend(gfile('scripts'), 'PATH')
     path_prepend(gfile('bin'), 'PATH')
     path_prepend(gfile('bin'), 'PATH')
 
 
     # Set PYTHONPATH to find GRASS Python modules
     # Set PYTHONPATH to find GRASS Python modules
-    path_prepend(gfile('etc', 'python'), 'PYTHONPATH')
+    if os.path.exists(gfile('gui', 'wxpython')):
+        path_prepend(gfile('gui', 'wxpython'), 'PYTHONPATH')
+    if os.path.exists(gfile('etc', 'python')):
+        path_prepend(gfile('etc', 'python'), 'PYTHONPATH')
 
 
     # set path for the GRASS man pages
     # set path for the GRASS man pages
     grass_man_path = os.path.join(gisbase, 'docs', 'man')
     grass_man_path = os.path.join(gisbase, 'docs', 'man')
@@ -539,7 +542,7 @@ def check_gui():
             p.wait()
             p.wait()
             if p.returncode == 0:
             if p.returncode == 0:
                 # Set the wxpython base directory
                 # Set the wxpython base directory
-                wxpython_base = gfile("etc", "gui", "wxpython")
+                wxpython_base = gfile("gui", "wxpython")
             else:
             else:
                 # Python was not found - switch to text interface mode
                 # Python was not found - switch to text interface mode
                 warning(_("The python command does not work as expected!\n"
                 warning(_("The python command does not work as expected!\n"
@@ -689,8 +692,7 @@ def set_data():
 
 
 def gui_startup(wscreen_only = False):
 def gui_startup(wscreen_only = False):
     if grass_gui in ('wxpython', 'gtext'):
     if grass_gui in ('wxpython', 'gtext'):
-        ret = call([os.getenv('GRASS_PYTHON'),
-                        gfile(wxpython_base, "gis_set.py")])
+        ret = call([os.getenv('GRASS_PYTHON'), gfile(wxpython_base, "gis_set.py")])
 
 
     if ret == 0:
     if ret == 0:
         pass
         pass
@@ -865,9 +867,7 @@ def check_lock():
 
 
     if msg:
     if msg:
         if grass_gui == "wxpython":
         if grass_gui == "wxpython":
-            call([os.getenv('GRASS_PYTHON'),
-                  os.path.join(wxpython_base, "gis_set_error.py"),
-                  msg])
+            call([os.getenv('GRASS_PYTHON'), gfile(wxpython_base, "gis_set_error.py"), msg])
         else:
         else:
             global remove_lockfile
             global remove_lockfile
             remove_lockfile = False
             remove_lockfile = False

+ 1 - 1
mswindows/GRASS-Installer.nsi.tmpl

@@ -812,7 +812,7 @@ Section "GRASS" SecGRASS
 	; FileWrite $0 'PATH="$$GISBASE/extrabin:$$PATH"$\r$\n'
 	; FileWrite $0 'PATH="$$GISBASE/extrabin:$$PATH"$\r$\n'
 	; FileWrite $0 'export PATH$\r$\n'
 	; FileWrite $0 'export PATH$\r$\n'
 	; FileWrite $0 '# Set the PYTHONPATH variable$\r$\n'
 	; FileWrite $0 '# Set the PYTHONPATH variable$\r$\n'
-	; FileWrite $0 'PYTHONPATH="$$GISBASE/etc/python:$$GISBASE/Python27:$$PYTHONPATH"$\r$\n'
+	; FileWrite $0 'PYTHONPATH="$$GISBASE/etc/python:$$GISBASE/gui/wxpython:$$GISBASE/Python27:$$PYTHONPATH"$\r$\n'
 	; FileWrite $0 'export PYTHONPATH$\r$\n'
 	; FileWrite $0 'export PYTHONPATH$\r$\n'
 	; FileWrite $0 'PYTHONHOME="$INSTALL_DIR\Python27"$\r$\n'
 	; FileWrite $0 'PYTHONHOME="$INSTALL_DIR\Python27"$\r$\n'
 	; FileWrite $0 'export PYTHONHOME$\r$\n'
 	; FileWrite $0 'export PYTHONHOME$\r$\n'