소스 검색

wxGUI: python package init files now part of source code (not in created my make, script for creation is in tools)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55919 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 12 년 전
부모
커밋
2383503c05

+ 0 - 1
gui/wxpython/Makefile

@@ -34,7 +34,6 @@ menustrings.py: core/menutree.py $(ETCDIR)/xml/menudata.xml $(ETCDIR)/xml/menuda
 
 
 $(PYDSTDIRS): %: | $(ETCDIR)
 $(PYDSTDIRS): %: | $(ETCDIR)
 	$(MKDIR) $@
 	$(MKDIR) $@
-	$(call run_grass,$(PYTHON) create__init__.py $@)
 
 
 $(DSTDIRS): %: | $(ETCDIR)
 $(DSTDIRS): %: | $(ETCDIR)
 	$(MKDIR) $@
 	$(MKDIR) $@

+ 12 - 0
gui/wxpython/animation/__init__.py

@@ -0,0 +1,12 @@
+all = [
+    'nviztask',
+    'temporal_manager',
+    'dialogs',
+    'mapwindow',
+    'g.gui.animation',
+    'controller',
+    'anim',
+    'toolbars',
+    'utils',
+    'frame',
+    ]

+ 16 - 0
gui/wxpython/core/__init__.py

@@ -0,0 +1,16 @@
+all = [
+    'debug',
+    'gcmd',
+    'treemodel',
+    'ws',
+    'menutree',
+    'gconsole',
+    'events',
+    'render',
+    'units',
+    'settings',
+    'workspace',
+    'utils',
+    'globalvar',
+    'giface',
+    ]

+ 8 - 0
gui/wxpython/dbmgr/__init__.py

@@ -0,0 +1,8 @@
+all = [
+    'g.gui.dbmgr',
+    'sqlbuilder',
+    'vinfo',
+    'manager',
+    'base',
+    'dialogs',
+    ]

+ 5 - 0
gui/wxpython/gcp/__init__.py

@@ -0,0 +1,5 @@
+all = [
+    'manager',
+    'mapdisplay',
+    'toolbars',
+    ]

+ 10 - 0
gui/wxpython/gmodeler/__init__.py

@@ -0,0 +1,10 @@
+all = [
+    'preferences',
+    'g.gui.gmodeler',
+    'menudata',
+    'model',
+    'pystc',
+    'dialogs',
+    'toolbars',
+    'frame',
+    ]

+ 16 - 0
gui/wxpython/gui_core/__init__.py

@@ -0,0 +1,16 @@
+all = [
+    'query',
+    'widgets',
+    'preferences',
+    'menu',
+    'dialogs',
+    'mapwindow',
+    'mapdisp',
+    'gselect',
+    'ghelp',
+    'prompt',
+    'goutput',
+    'forms',
+    'toolbars',
+    'treeview',
+    ]

+ 9 - 0
gui/wxpython/iclass/__init__.py

@@ -0,0 +1,9 @@
+all = [
+    'digit',
+    'plots',
+    'dialogs',
+    'g.gui.iclass',
+    'toolbars',
+    'statistics',
+    'frame',
+    ]

+ 8 - 0
gui/wxpython/lmgr/__init__.py

@@ -0,0 +1,8 @@
+all = [
+    'layertree',
+    'menudata',
+    'toolbars',
+    'pyshell',
+    'frame',
+    'giface',
+    ]

+ 5 - 0
gui/wxpython/location_wizard/__init__.py

@@ -0,0 +1,5 @@
+all = [
+    'wizard',
+    'base',
+    'dialogs',
+    ]

+ 9 - 0
gui/wxpython/mapdisp/__init__.py

@@ -0,0 +1,9 @@
+all = [
+    'overlays',
+    'main',
+    'statusbar',
+    'mapwindow',
+    'toolbars',
+    'frame',
+    'gprint',
+    ]

+ 7 - 0
gui/wxpython/mapswipe/__init__.py

@@ -0,0 +1,7 @@
+all = [
+    'g.gui.mapswipe',
+    'dialogs',
+    'mapwindow',
+    'toolbars',
+    'frame',
+    ]

+ 7 - 0
gui/wxpython/modules/__init__.py

@@ -0,0 +1,7 @@
+all = [
+    'mcalc_builder',
+    'extensions',
+    'vclean',
+    'colorrules',
+    'histogram',
+    ]

+ 9 - 0
gui/wxpython/nviz/__init__.py

@@ -0,0 +1,9 @@
+all = [
+    'preferences',
+    'main',
+    'mapwindow',
+    'tools',
+    'wxnviz',
+    'workspace',
+    'animation',
+    ]

+ 9 - 0
gui/wxpython/psmap/__init__.py

@@ -0,0 +1,9 @@
+all = [
+    'g.gui.psmap',
+    'menudata',
+    'dialogs',
+    'instructions',
+    'toolbars',
+    'utils',
+    'frame',
+    ]

+ 6 - 0
gui/wxpython/rlisetup/__init__.py

@@ -0,0 +1,6 @@
+all = [
+    'g.gui.rlisetup',
+    'wizard',
+    'functions',
+    'frame',
+    ]

+ 10 - 0
gui/wxpython/vdigit/__init__.py

@@ -0,0 +1,10 @@
+all = [
+    'preferences',
+    'main',
+    'wxdigit',
+    'dialogs',
+    'mapwindow',
+    'wxdisplay',
+    'g.gui.vdigit',
+    'toolbars',
+    ]

+ 5 - 0
gui/wxpython/vnet/__init__.py

@@ -0,0 +1,5 @@
+all = [
+    'widgets',
+    'dialogs',
+    'toolbars',
+    ]

+ 5 - 0
gui/wxpython/web_services/__init__.py

@@ -0,0 +1,5 @@
+all = [
+    'widgets',
+    'cap_interface',
+    'dialogs',
+    ]

+ 7 - 0
gui/wxpython/wxplot/__init__.py

@@ -0,0 +1,7 @@
+all = [
+    'scatter',
+    'base',
+    'dialogs',
+    'profile',
+    'histogram',
+    ]

+ 23 - 6
gui/wxpython/create__init__.py

@@ -1,20 +1,37 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
+"""
+Script for creating an __init__.py file for a package.
+
+Adds all modules (*.py files) in a directory into an __init__.py file.
+Overwrites existing __init__.py file in a directory.
+
+(C) 2011-2013 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 for details.
+
+@author Martin Landa <landa.martin gmail.com>
+@author Vaclav Petras <wenzeslaus gmail.com>
+"""
+
 
 
 import os
 import os
 import sys
 import sys
 import glob
 import glob
 
 
+
 def main(path):
 def main(path):
     if not os.path.exists(path) or not os.path.isdir(path):
     if not os.path.exists(path) or not os.path.isdir(path):
         print >> sys.stderr, "'%s' is not a directory" % path
         print >> sys.stderr, "'%s' is not a directory" % path
         return 1
         return 1
-    
+
     modules = []
     modules = []
-    for f in glob.glob(os.path.join(os.path.basename(path), '*.py')):
+    pattern = os.path.join(path, '*.py')
+    for f in glob.glob(pattern):
         if f[-5:-3] == '__':
         if f[-5:-3] == '__':
             continue
             continue
         modules.append(os.path.splitext(os.path.basename(f))[0])
         modules.append(os.path.splitext(os.path.basename(f))[0])
-        
+
     fd = open(os.path.join(path, '__init__.py'), 'w')
     fd = open(os.path.join(path, '__init__.py'), 'w')
     try:
     try:
         fd.write('all = [%s' % os.linesep)
         fd.write('all = [%s' % os.linesep)
@@ -23,11 +40,11 @@ def main(path):
         fd.write('    ]%s' % os.linesep)
         fd.write('    ]%s' % os.linesep)
     finally:
     finally:
         fd.close()
         fd.close()
-    
+
     return 0
     return 0
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
     if len(sys.argv) < 2:
     if len(sys.argv) < 2:
-        sys.exit("usage: %s path/to/gui_modules" % sys.argv[0])
-    
+        sys.exit("usage: %s path/to/package/directory" % sys.argv[0])
+
     sys.exit(main(sys.argv[1]))
     sys.exit(main(sys.argv[1]))