Bladeren bron

etc/wxpython -> etc/gui/wxpython

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41557 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 jaren geleden
bovenliggende
commit
4b2c2b4f24

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

@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
     G_debug(1, "Attempting to start '%s' GUI ...", type->answer);
 
     if (strcmp(type->answer, "wxpython") == 0) {
-	sprintf(progname, "%s/etc/wxpython/wxgui.py", G_gisbase());
+	sprintf(progname, "%s/etc/gui/wxpython/wxgui.py", G_gisbase());
 	if (rc_file->answer) {
 	    G_spawn_ex(getenv("GRASS_PYTHON"), progname, progname,
 		    "--workspace", rc_file->answer, SF_BACKGROUND, NULL);

+ 1 - 1
gui/wxpython/Makefile

@@ -8,7 +8,7 @@ include $(MODULE_TOPDIR)/include/Make/Dir.make
 include $(MODULE_TOPDIR)/include/Make/Doxygen.make
 include $(MODULE_TOPDIR)/include/Make/Python.make
 
-ETCDIR = $(ETC)/wxpython
+ETCDIR = $(ETC)/gui/wxpython
 
 SRCFILES := $(wildcard scripts/p.* compat/* gui_modules/* icons/*.* icons/silk/* images/* xml/*) gis_set.py wxgui.py README
 DSTFILES := $(patsubst %,$(ETCDIR)/%,$(SRCFILES)) $(patsubst %.py,$(ETCDIR)/%.pyc,$(filter %.py,$(SRCFILES)))

+ 1 - 1
gui/wxpython/gis_set.py

@@ -715,7 +715,7 @@ class GRASSStartup(wx.Frame):
     def OnExit(self, event):
         """'Exit' button clicked"""
         self.Destroy()
-        sys.exit (2)
+        sys.exit(2)
 
     def OnHelp(self, event):
         """'Help' button clicked"""

+ 1 - 1
gui/wxpython/gui_modules/globalvar.py

@@ -79,7 +79,7 @@ QUERYLAYER = 'qlayer'
 # 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, "wxpython")
+ETCWXDIR = os.path.join(ETCDIR, "gui", "wxpython")
 
 """!Style definition for FlatNotebook pages"""
 FNPageStyle = FN.FNB_VC8 | \

+ 3 - 1
gui/wxpython/gui_modules/menudata.py

@@ -36,12 +36,14 @@ try:
 except ImportError:
     import elementtree.ElementTree as etree # Python <= 2.4
 
+import globalvar
+
 class Data:
     '''!Data object that returns menu descriptions to be used in wxgui.py.'''
     def __init__(self, filename=None):
         if not filename:
             gisbase = os.getenv('GISBASE')
-	    filename = os.path.join(gisbase, 'etc', 'wxpython', 'xml', 'menudata.xml')
+	    filename = os.path.join(globalvar.ETCWXDIR, 'xml', 'menudata.xml')
 	self.tree = etree.parse(filename)
 
     def getMenuItem(self, mi):

+ 1 - 1
gui/wxpython/nviz/Makefile

@@ -13,7 +13,7 @@ LIB_NAME = grass7_wxnviz
 
 SHLIB = $(OBJDIR)/_$(LIB_NAME).so
 
-ETCDIR = $(ETC)/wxpython
+ETCDIR = $(ETC)/gui/wxpython
 
 EXTRA_CLEAN_FILES = $(LIB_NAME).i $(LIB_NAME).py $(LIB_NAME)_wrap.cpp
 

+ 1 - 1
gui/wxpython/vdigit/Makefile

@@ -13,7 +13,7 @@ LIB_NAME = grass7_wxvdigit
 
 SHLIB = $(OBJDIR)/_$(LIB_NAME).so
 
-ETCDIR = $(ETC)/wxpython
+ETCDIR = $(ETC)/gui/wxpython
 
 EXTRA_CLEAN_FILES = $(LIB_NAME).i $(LIB_NAME).py $(LIB_NAME)_wrap.cpp
 

+ 3 - 5
lib/init/grass.py

@@ -15,7 +15,7 @@
 #   	    	command line options for setting the GISDBASE, LOCATION, and/or
 #   	    	MAPSET. Finally it starts GRASS with the appropriate user
 #   	    	interface and cleans up after it is finished.
-# COPYRIGHT:    (C) 2000-2009 by the GRASS Development Team
+# COPYRIGHT:    (C) 2000-2010 by the GRASS Development Team
 #
 #               This program is free software under the GNU General Public
 #   	    	License (>=v2). Read the file COPYING that comes with GRASS
@@ -364,7 +364,7 @@ def check_gui():
 	    p.wait()
 	    if p.returncode == 0:
 		# Set the wxpython base directory
-		wxpython_base = gfile("etc","wxpython")
+		wxpython_base = gfile("etc", "gui", "wxpython")
 	    else:
 		# Python was not found - switch to text interface mode
 		message(
@@ -469,8 +469,6 @@ def set_data():
 
 def gui_startup():
     if grass_gui == 'wxpython':
-	# eval `foo` will return subshell return code and not app foo return code!!!
-	#	eval '"$GRASS_PYTHON" "$WXPYTHONGRASSBASE/gis_set.py"'
 	thetest = call([os.getenv('GRASS_PYTHON'), os.path.join(wxpython_base, "gis_set.py")])
 
     if thetest == 0:
@@ -595,7 +593,7 @@ def start_gui():
     # Check for gui interface
     if grass_gui == "wxpython":
         subprocess.Popen([os.getenv('GRASS_PYTHON'),
-                          gfile("etc", "wxpython", "wxgui.py")])
+                          gfile(wxpython_base, "wxgui.py")])
     
 def clear_screen():
     if windows: