Преглед изворни кода

move v.krige and r.li.setup from gui_modules to scripts

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41729 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa пре 15 година
родитељ
комит
a31c10c35e

+ 2 - 2
gui/wxpython/Makefile

@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../..
 
-SUBDIRS = docs scripts vdigit nviz
+SUBDIRS = docs vdigit nviz
 EXTRA_CLEAN_FILES = menustrings.py
 CLEAN_SUBDIRS = vdigit nviz
 
@@ -10,7 +10,7 @@ include $(MODULE_TOPDIR)/include/Make/Python.make
 
 ETCDIR = $(ETC)/gui/wxpython
 
-SRCFILES := $(wildcard scripts/p.* compat/* gui_modules/* icons/*.* icons/silk/* images/* xml/*) gis_set.py wxgui.py README
+SRCFILES := $(wildcard scripts/* 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)))
 
 DSTDIRS := $(patsubst %,$(ETCDIR)/%,compat gui_modules icons icons/silk images scripts vdigit xml nviz)

+ 0 - 16
gui/wxpython/scripts/Makefile

@@ -1,16 +0,0 @@
-MODULE_TOPDIR = ../../..
-
-include $(MODULE_TOPDIR)/include/Make/Dir.make
-
-ETCDIR = $(ETC)/gui/scripts
-
-default: install_scripts
-
-install_scripts:
-	$(MAKE) $(ETCDIR)/d.rast3d
-
-$(ETCDIR)/%: % | $(ETC)/gui
-	$(INSTALL) $< $@
-
-$(ETC)/gui:
-	$(MKDIR) $@

gui/wxpython/gui_modules/r_li_setup_GUI.py → gui/wxpython/scripts/r.li.setup.py


+ 2 - 4
gui/wxpython/gui_modules/v_krige_wxGUI.py

@@ -33,10 +33,8 @@ except ImportError:
     sys.exit(_("No GRASS-python library found."))
 ### wxGUI imports
 
-GUIModulesPath = os.path.join(os.getenv("GISBASE"), "etc", "wxpython", "gui_modules")
+GUIModulesPath = os.path.join(os.getenv("GISBASE"), "etc", "gui", "wxpython", "gui_modules")
 sys.path.append(GUIModulesPath)
-GUIPath = os.path.join(os.getenv("GISBASE"), "etc", "wxpython")
-sys.path.append(GUIPath)
 
 import globalvar
 if not os.getenv("GRASS_WXBUNDLED"):
@@ -399,7 +397,7 @@ class RBookgstatPanel(RBookPanel):
             self.SetSizerAndFit(self.Sizer)
             self.VariogramCheckBox.Bind(wx.EVT_CHECKBOX, self.HideOptions)
             self.VariogramCheckBox.SetValue(state = True) # check it by default
-
+        
         ModelFactor = robjects.r.vgm().r['long']
         ModelList = robjects.r.levels(ModelFactor[0])
         #@FIXME: no other way to let the Python pick it up..

+ 15 - 23
scripts/v.krige/v.krige.py

@@ -104,23 +104,11 @@ from tempfile import gettempdir
 import time
 import thread
 
-GUIModulesPath = os.path.join(os.getenv("GISBASE"), "etc", "wxpython", "gui_modules")
+GUIModulesPath = os.path.join(os.getenv("GISBASE"), "etc", "gui", "wxpython", "gui_modules")
 sys.path.append(GUIModulesPath)
-#GUIPath = os.path.join(os.getenv("GISBASE"), "etc", "wxpython")
-#sys.path.append(GUIPath)
-#
-#import globalvar
-#if not os.getenv("GRASS_WXBUNDLED"):
-#    globalvar.CheckForWx()
-#import gselect
-#import goutput
-#import menuform
-#from preferences import globalSettings as UserSettings
-##import help
-#
-#import wx
-#import wx.lib.flatnotebook as FN
-##import wx.lib.plot as plot # for plotting the variogram.
+
+GUIPath = os.path.join(os.getenv("GISBASE"), "etc", "gui", "wxpython", "scripts")
+sys.path.append(GUIPath)
 
 ### i18N
 import gettext
@@ -131,7 +119,7 @@ gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unico
 try:
     import grass.script as grass
 except ImportError:
-    sys.exit(_("No GRASS-python library found."))
+    sys.exit(_("No GRASS-python library found"))
     
 # move other checks in functions, as R?
 
@@ -307,15 +295,19 @@ def main(argv = None):
     
     if argv is None:
         importR()
-        argv = sys.argv[1:] #stripping first item, the full name of this script
-        # wxGUI call.
-        import v_krige_wxGUI
+        argv = sys.argv[1:] # stripping first item, the full name of this script
+        # wxGUI call
+        import globalvar
+        if not os.getenv("GRASS_WXBUNDLED"):
+            globalvar.CheckForWx()
+        import vkrige as GUI
+        
         import wx
         
         app = wx.App()
-        KrigingFrame = v_krige_wxGUI.KrigingModule(parent = None,
-                                                   Rinstance = robjects,
-                                                   controller = controller)
+        KrigingFrame = GUI.KrigingModule(parent = None,
+                                         Rinstance = robjects,
+                                         controller = controller)
         KrigingFrame.Centre()
         KrigingFrame.Show()
         app.MainLoop()