Pārlūkot izejas kodu

grass.script.all added
(merge from devbr6, https://trac.osgeo.org/grass/changeset/37545)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@37546 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 gadi atpakaļ
vecāks
revīzija
8cdd054272
4 mainītis faili ar 14 papildinājumiem un 8 dzēšanām
  1. 1 1
      lib/python/Makefile
  2. 6 4
      lib/python/__init__.py
  3. 4 0
      lib/python/all.py
  4. 3 3
      lib/python/grasspythonlib.dox

+ 1 - 1
lib/python/Makefile

@@ -7,7 +7,7 @@ PYDIR = $(ETC)/python
 GDIR = $(PYDIR)/grass
 DSTDIR = $(GDIR)/script
 
-MODULES = core db raster vector
+MODULES = core db raster vector all
 
 PYFILES := $(patsubst %,$(DSTDIR)/%.py,$(MODULES) __init__)
 

+ 6 - 4
lib/python/__init__.py

@@ -1,4 +1,6 @@
-import core
-import db
-import raster
-import vector
+all = ['core',
+       'db',
+       'raster',
+       'vector',
+       'all'
+       ]

+ 4 - 0
lib/python/all.py

@@ -0,0 +1,4 @@
+from core   import *
+from db     import *
+from raster import *
+from vector import *

+ 3 - 3
lib/python/grasspythonlib.dox

@@ -30,13 +30,13 @@ See code in:
 Usage:
 
 \code
-from grass.script import core[,db[,raster,[vector]]] as grass
+from grass.script import all as grass
 \endcode
 
-e.g. to import functions from "core" and "vector" modules use
+or just import selected module, e.g.
 
 \code
-from grass.script import core, vector as grass
+from grass.script import core as grass
 \endcode
 
 Sample script