[GRASS-SVN] r70357 - in grass/trunk: scripts/v.what.strds temporal/t.create temporal/t.info temporal/t.list temporal/t.merge temporal/t.rast.accdetect temporal/t.rast.accumulate temporal/t.rast.aggregate temporal/t.rast.aggregate.ds temporal/t.rast.algebra temporal/t.rast.colors temporal/t.rast.contour temporal/t.rast.export temporal/t.rast.extract temporal/t.rast.gapfill temporal/t.rast.import temporal/t.rast.list temporal/t.rast.mapcalc temporal/t.rast.neighbors temporal/t.rast.out.vtk temporal/t.rast.series temporal/t.rast.to.rast3 temporal/t.rast.to.vect temporal/t.rast.univar temporal/t.rast.what temporal/t.rast3d.algebra temporal/t.rast3d.extract temporal/t.rast3d.list temporal/t.rast3d.mapcalc temporal/t.rast3d.univar temporal/t.register temporal/t.remove temporal/t.rename temporal/t.sample temporal/t.select temporal/t.shift temporal/t.snap temporal/t.support temporal/t.topology temporal/t.unregister temporal/t.vect.algebra temporal/t.vect.db.select temporal/t.vect.export tempora l/t.vect.extract temporal/t.vect.import temporal/t.vect.list temporal/t.vect.observe.strds temporal/t.vect.univar temporal/t.vect.what.strds

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 12 20:01:45 PST 2017


Author: wenzeslaus
Date: 2017-01-12 20:01:44 -0800 (Thu, 12 Jan 2017)
New Revision: 70357

Modified:
   grass/trunk/scripts/v.what.strds/v.what.strds.py
   grass/trunk/temporal/t.create/t.create.py
   grass/trunk/temporal/t.info/t.info.py
   grass/trunk/temporal/t.list/t.list.py
   grass/trunk/temporal/t.merge/t.merge.py
   grass/trunk/temporal/t.rast.accdetect/t.rast.accdetect.py
   grass/trunk/temporal/t.rast.accumulate/t.rast.accumulate.py
   grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py
   grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py
   grass/trunk/temporal/t.rast.algebra/t.rast.algebra.py
   grass/trunk/temporal/t.rast.colors/t.rast.colors.py
   grass/trunk/temporal/t.rast.contour/t.rast.contour.py
   grass/trunk/temporal/t.rast.export/t.rast.export.py
   grass/trunk/temporal/t.rast.extract/t.rast.extract.py
   grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py
   grass/trunk/temporal/t.rast.import/t.rast.import.py
   grass/trunk/temporal/t.rast.list/t.rast.list.py
   grass/trunk/temporal/t.rast.mapcalc/t.rast.mapcalc.py
   grass/trunk/temporal/t.rast.neighbors/t.rast.neighbors.py
   grass/trunk/temporal/t.rast.out.vtk/t.rast.out.vtk.py
   grass/trunk/temporal/t.rast.series/t.rast.series.py
   grass/trunk/temporal/t.rast.to.rast3/t.rast.to.rast3.py
   grass/trunk/temporal/t.rast.to.vect/t.rast.to.vect.py
   grass/trunk/temporal/t.rast.univar/t.rast.univar.py
   grass/trunk/temporal/t.rast.what/t.rast.what.py
   grass/trunk/temporal/t.rast3d.algebra/t.rast3d.algebra.py
   grass/trunk/temporal/t.rast3d.extract/t.rast3d.extract.py
   grass/trunk/temporal/t.rast3d.list/t.rast3d.list.py
   grass/trunk/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py
   grass/trunk/temporal/t.rast3d.univar/t.rast3d.univar.py
   grass/trunk/temporal/t.register/t.register.py
   grass/trunk/temporal/t.remove/t.remove.py
   grass/trunk/temporal/t.rename/t.rename.py
   grass/trunk/temporal/t.sample/t.sample.py
   grass/trunk/temporal/t.select/t.select.py
   grass/trunk/temporal/t.shift/t.shift.py
   grass/trunk/temporal/t.snap/t.snap.py
   grass/trunk/temporal/t.support/t.support.py
   grass/trunk/temporal/t.topology/t.topology.py
   grass/trunk/temporal/t.unregister/t.unregister.py
   grass/trunk/temporal/t.vect.algebra/t.vect.algebra.py
   grass/trunk/temporal/t.vect.db.select/t.vect.db.select.py
   grass/trunk/temporal/t.vect.export/t.vect.export.py
   grass/trunk/temporal/t.vect.extract/t.vect.extract.py
   grass/trunk/temporal/t.vect.import/t.vect.import.py
   grass/trunk/temporal/t.vect.list/t.vect.list.py
   grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py
   grass/trunk/temporal/t.vect.univar/t.vect.univar.py
   grass/trunk/temporal/t.vect.what.strds/t.vect.what.strds.py
Log:
use lazy imports for the temporal package

This avoids ctypes-related issues during compilation (see #3257).

Using beginning of main function if possible.
If not adding to the if __name__... global part with a note
about imports being at the end of the file.
Adding pygrass imports if used (even modules import ctypes through __init__.py).


Modified: grass/trunk/scripts/v.what.strds/v.what.strds.py
===================================================================
--- grass/trunk/scripts/v.what.strds/v.what.strds.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/scripts/v.what.strds/v.what.strds.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -50,10 +50,6 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
-from grass.pygrass.utils import copy as gcopy
-from grass.pygrass.messages import Messenger
-from grass.pygrass.vector import Vector
 from grass.exceptions import CalledModuleError
 
 ############################################################################
@@ -95,6 +91,12 @@
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
+    from grass.pygrass.utils import copy as gcopy
+    from grass.pygrass.messages import Messenger
+    from grass.pygrass.vector import Vector
+    
     # Get the options
     input = options["input"]
     output = options["output"]

Modified: grass/trunk/temporal/t.create/t.create.py
===================================================================
--- grass/trunk/temporal/t.create/t.create.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.create/t.create.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -59,12 +59,13 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     name = options["output"]

Modified: grass/trunk/temporal/t.info/t.info.py
===================================================================
--- grass/trunk/temporal/t.info/t.info.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.info/t.info.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -50,12 +50,13 @@
 from __future__ import print_function
 
 import grass.script as grass
-import grass.temporal as tgis
 
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     name = options["input"]
     type_ = options["type"]

Modified: grass/trunk/temporal/t.list/t.list.py
===================================================================
--- grass/trunk/temporal/t.list/t.list.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.list/t.list.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -80,15 +80,17 @@
 #% description: Print the column names as first row
 #% guisection: Formatting
 #%end
+
 from __future__ import print_function
 import grass.script as gscript
-import grass.temporal as tgis
 import sys
 
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     type = options["type"]

Modified: grass/trunk/temporal/t.merge/t.merge.py
===================================================================
--- grass/trunk/temporal/t.merge/t.merge.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.merge/t.merge.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -33,13 +33,15 @@
 #% guisection: Required
 #%end
 
-import grass.temporal as tgis
 import grass.script as grass
 
+
 ############################################################################
 grass.set_raise_on_error(True)
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     inputs = options["inputs"]

Modified: grass/trunk/temporal/t.rast.accdetect/t.rast.accdetect.py
===================================================================
--- grass/trunk/temporal/t.rast.accdetect/t.rast.accdetect.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.accdetect/t.rast.accdetect.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -130,9 +130,11 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
 
+# lazy imports at the end of the file
+
+
 ############################################################################
 
 range_relations = ["EQUALS", "DURING", "OVERLAPS", "OVERLAPPING", "CONTAINS"]
@@ -585,4 +587,6 @@
 
 if __name__ == "__main__":
     options, flags = grass.parser()
+    # lazy imports
+    import grass.temporal as tgis
     main()

Modified: grass/trunk/temporal/t.rast.accumulate/t.rast.accumulate.py
===================================================================
--- grass/trunk/temporal/t.rast.accumulate/t.rast.accumulate.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.accumulate/t.rast.accumulate.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -149,13 +149,15 @@
 from __future__ import print_function
 
 import grass.script as grass
-import grass.temporal as tgis
-from grass.pygrass.modules import Module
 from copy import copy
 
 ############################################################################
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
+    from grass.pygrass.modules import Module
+
     # Get the options
     input = options["input"]
     output = options["output"]

Modified: grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py
===================================================================
--- grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.aggregate/t.rast.aggregate.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -106,11 +106,13 @@
 #%end
 
 import grass.script as gcore
-import grass.temporal as tgis
 
+
 ############################################################################
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py
===================================================================
--- grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.aggregate.ds/t.rast.aggregate.ds.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -98,12 +98,14 @@
 #%end
 
 import grass.script as gcore
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.algebra/t.rast.algebra.py
===================================================================
--- grass/trunk/temporal/t.rast.algebra/t.rast.algebra.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.algebra/t.rast.algebra.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -69,10 +69,13 @@
 #%end
 
 import grass.script
-import grass.temporal as tgis
 import sys
 
+
 def main():
+    # lazy imports
+    import grass.temporal as tgis
+
     expression = options['expression']
     basename = options['basename']
     nprocs = options["nprocs"]

Modified: grass/trunk/temporal/t.rast.colors/t.rast.colors.py
===================================================================
--- grass/trunk/temporal/t.rast.colors/t.rast.colors.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.colors/t.rast.colors.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -97,13 +97,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 from grass.exceptions import CalledModuleError
 
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.contour/t.rast.contour.py
===================================================================
--- grass/trunk/temporal/t.rast.contour/t.rast.contour.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.contour/t.rast.contour.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -114,14 +114,15 @@
 import sys
 import copy
 import grass.script as gscript
-import grass.temporal as tgis
-import grass.pygrass.modules as pymod
 from grass.exceptions import FatalError
 
 
 ############################################################################
 
 def main(options, flags):
+    # lazy imports
+    import grass.temporal as tgis
+    import grass.pygrass.modules as pymod
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.export/t.rast.export.py
===================================================================
--- grass/trunk/temporal/t.rast.export/t.rast.export.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.export/t.rast.export.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -71,11 +71,12 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
 
 ############################################################################
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     _input = options["input"]

Modified: grass/trunk/temporal/t.rast.extract/t.rast.extract.py
===================================================================
--- grass/trunk/temporal/t.rast.extract/t.rast.extract.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.extract/t.rast.extract.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -74,12 +74,14 @@
 
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py
===================================================================
--- grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.gapfill/t.rast.gapfill.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -65,15 +65,15 @@
 import copy
 from multiprocessing import Process
 import grass.script as grass
-import grass.temporal as tgis
-
-import grass.pygrass.modules as pymod
 from grass.exceptions import FatalError
 
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
+    import grass.pygrass.modules as pymod
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.import/t.rast.import.py
===================================================================
--- grass/trunk/temporal/t.rast.import/t.rast.import.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.import/t.rast.import.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -105,10 +105,11 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.list/t.rast.list.py
===================================================================
--- grass/trunk/temporal/t.rast.list/t.rast.list.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.list/t.rast.list.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -86,12 +86,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.mapcalc/t.rast.mapcalc.py
===================================================================
--- grass/trunk/temporal/t.rast.mapcalc/t.rast.mapcalc.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.mapcalc/t.rast.mapcalc.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -68,12 +68,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     inputs = options["inputs"]

Modified: grass/trunk/temporal/t.rast.neighbors/t.rast.neighbors.py
===================================================================
--- grass/trunk/temporal/t.rast.neighbors/t.rast.neighbors.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.neighbors/t.rast.neighbors.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -93,13 +93,14 @@
 
 import copy
 import grass.script as grass
-import grass.temporal as tgis
-import grass.pygrass.modules as pymod
 
 
 ############################################################################
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
+    import grass.pygrass.modules as pymod
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.out.vtk/t.rast.out.vtk.py
===================================================================
--- grass/trunk/temporal/t.rast.out.vtk/t.rast.out.vtk.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.out.vtk/t.rast.out.vtk.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -67,13 +67,14 @@
 
 import os
 import grass.script as grass
-import grass.temporal as tgis
 from grass.exceptions import CalledModuleError
 
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.series/t.rast.series.py
===================================================================
--- grass/trunk/temporal/t.rast.series/t.rast.series.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.series/t.rast.series.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -65,13 +65,14 @@
 
 
 import grass.script as grass
-import grass.temporal as tgis
 from grass.exceptions import CalledModuleError
 
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.to.rast3/t.rast.to.rast3.py
===================================================================
--- grass/trunk/temporal/t.rast.to.rast3/t.rast.to.rast3.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.to.rast3/t.rast.to.rast3.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -33,7 +33,6 @@
 
 import os
 import grass.script as grass
-import grass.temporal as tgis
 from datetime import datetime
 from grass.exceptions import CalledModuleError
 
@@ -41,6 +40,8 @@
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.to.vect/t.rast.to.vect.py
===================================================================
--- grass/trunk/temporal/t.rast.to.vect/t.rast.to.vect.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.to.vect/t.rast.to.vect.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -113,13 +113,14 @@
 import sys
 import copy
 import grass.script as gscript
-import grass.temporal as tgis
-import grass.pygrass.modules as pymod
 
 
 ############################################################################
 
 def main(options, flags):
+    # lazy imports
+    import grass.temporal as tgis
+    import grass.pygrass.modules as pymod
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.univar/t.rast.univar.py
===================================================================
--- grass/trunk/temporal/t.rast.univar/t.rast.univar.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.univar/t.rast.univar.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -55,12 +55,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast.what/t.rast.what.py
===================================================================
--- grass/trunk/temporal/t.rast.what/t.rast.what.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast.what/t.rast.what.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -112,13 +112,14 @@
 import sys
 import copy
 import grass.script as gscript
-import grass.temporal as tgis
-import grass.pygrass.modules as pymod
 
 
 ############################################################################
 
 def main(options, flags):
+    # lazy imports
+    import grass.temporal as tgis
+    import grass.pygrass.modules as pymod
 
     # Get the options
     points = options["points"]

Modified: grass/trunk/temporal/t.rast3d.algebra/t.rast3d.algebra.py
===================================================================
--- grass/trunk/temporal/t.rast3d.algebra/t.rast3d.algebra.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast3d.algebra/t.rast3d.algebra.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -66,10 +66,13 @@
 
 
 import grass.script
-import grass.temporal as tgis
 import sys
 
+
 def main():
+    # lazy imports
+    import grass.temporal as tgis
+
     expression = options['expression']
     basename = options['basename']
     nprocs = options["nprocs"]

Modified: grass/trunk/temporal/t.rast3d.extract/t.rast3d.extract.py
===================================================================
--- grass/trunk/temporal/t.rast3d.extract/t.rast3d.extract.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast3d.extract/t.rast3d.extract.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -72,12 +72,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast3d.list/t.rast3d.list.py
===================================================================
--- grass/trunk/temporal/t.rast3d.list/t.rast3d.list.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast3d.list/t.rast3d.list.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -78,12 +78,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py
===================================================================
--- grass/trunk/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast3d.mapcalc/t.rast3d.mapcalc.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -74,12 +74,14 @@
 from multiprocessing import Process
 import copy
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     inputs = options["inputs"]

Modified: grass/trunk/temporal/t.rast3d.univar/t.rast3d.univar.py
===================================================================
--- grass/trunk/temporal/t.rast3d.univar/t.rast3d.univar.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rast3d.univar/t.rast3d.univar.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -52,12 +52,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.register/t.register.py
===================================================================
--- grass/trunk/temporal/t.register/t.register.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.register/t.register.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -99,13 +99,12 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
-
     # Get the options
     name = options["input"]
     maps = options["maps"]
@@ -131,6 +130,9 @@
 if __name__ == "__main__":
     options, flags = grass.parser()
 
+    # lazy imports
+    import grass.temporal as tgis
+
     try:
         from builtins import StandardError
     except ImportError:

Modified: grass/trunk/temporal/t.remove/t.remove.py
===================================================================
--- grass/trunk/temporal/t.remove/t.remove.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.remove/t.remove.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -56,13 +56,13 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
-import grass.pygrass.modules as pyg
 
+
+# lazy imports at the end of the file
+
 ############################################################################
 
 def main():
-
     # Get the options
     datasets = options["inputs"]
     file = options["file"]
@@ -163,5 +163,9 @@
 
 if __name__ == "__main__":
     options, flags = grass.parser()
-    
+
+    # lazy imports
+    import grass.temporal as tgis
+    import grass.pygrass.modules as pyg
+
     tgis.profile_function(main)

Modified: grass/trunk/temporal/t.rename/t.rename.py
===================================================================
--- grass/trunk/temporal/t.rename/t.rename.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.rename/t.rename.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -33,13 +33,14 @@
 #% guisection: Required
 #%end
 
-import grass.temporal as tgis
 import grass.script as grass
 
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.sample/t.sample.py
===================================================================
--- grass/trunk/temporal/t.sample/t.sample.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.sample/t.sample.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -61,11 +61,13 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     inputs = options["inputs"]

Modified: grass/trunk/temporal/t.select/t.select.py
===================================================================
--- grass/trunk/temporal/t.select/t.select.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.select/t.select.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -47,12 +47,13 @@
 
 
 import grass.script as grass
-import grass.temporal as tgis
 import sys
 
 ############################################################################
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     expression = options['expression']
     spatial = flags["s"]

Modified: grass/trunk/temporal/t.shift/t.shift.py
===================================================================
--- grass/trunk/temporal/t.shift/t.shift.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.shift/t.shift.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -41,12 +41,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     name = options["input"]
     type = options["type"]

Modified: grass/trunk/temporal/t.snap/t.snap.py
===================================================================
--- grass/trunk/temporal/t.snap/t.snap.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.snap/t.snap.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -32,12 +32,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     name = options["input"]
     type = options["type"]

Modified: grass/trunk/temporal/t.support/t.support.py
===================================================================
--- grass/trunk/temporal/t.support/t.support.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.support/t.support.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -76,11 +76,13 @@
 
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     name = options["input"]

Modified: grass/trunk/temporal/t.topology/t.topology.py
===================================================================
--- grass/trunk/temporal/t.topology/t.topology.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.topology/t.topology.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -44,12 +44,14 @@
 from __future__ import print_function
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     name = options["input"]

Modified: grass/trunk/temporal/t.unregister/t.unregister.py
===================================================================
--- grass/trunk/temporal/t.unregister/t.unregister.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.unregister/t.unregister.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -43,13 +43,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
+# lazy imports at the end of the file
+
 ############################################################################
 
 
 def main():
-
     # Get the options
     file = options["file"]
     input = options["input"]
@@ -175,5 +176,8 @@
 
 if __name__ == "__main__":
     options, flags = grass.parser()
-    
+
+    # lazy imports
+    import grass.temporal as tgis
+
     tgis.profile_function(main)

Modified: grass/trunk/temporal/t.vect.algebra/t.vect.algebra.py
===================================================================
--- grass/trunk/temporal/t.vect.algebra/t.vect.algebra.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.vect.algebra/t.vect.algebra.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -47,10 +47,12 @@
 #%end
 
 import grass.script
-import grass.temporal as tgis
 import sys
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
+
     expression = options['expression']
     basename = options['basename']
     spatial = flags["s"]

Modified: grass/trunk/temporal/t.vect.db.select/t.vect.db.select.py
===================================================================
--- grass/trunk/temporal/t.vect.db.select/t.vect.db.select.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.vect.db.select/t.vect.db.select.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -46,12 +46,14 @@
 from __future__ import print_function
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.vect.export/t.vect.export.py
===================================================================
--- grass/trunk/temporal/t.vect.export/t.vect.export.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.vect.export/t.vect.export.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -61,11 +61,12 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
 
 ############################################################################
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     _input = options["input"]

Modified: grass/trunk/temporal/t.vect.extract/t.vect.extract.py
===================================================================
--- grass/trunk/temporal/t.vect.extract/t.vect.extract.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.vect.extract/t.vect.extract.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -75,12 +75,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.vect.import/t.vect.import.py
===================================================================
--- grass/trunk/temporal/t.vect.import/t.vect.import.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.vect.import/t.vect.import.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -83,10 +83,11 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.vect.list/t.vect.list.py
===================================================================
--- grass/trunk/temporal/t.vect.list/t.vect.list.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.vect.list/t.vect.list.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -78,12 +78,14 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 
 def main():
+    #lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py
===================================================================
--- grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.vect.observe.strds/t.vect.observe.strds.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -49,7 +49,6 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 import grass.script.raster as raster
 from grass.exceptions import CalledModuleError
 
@@ -70,6 +69,8 @@
 ############################################################################
 
 def main():
+    #lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.vect.univar/t.vect.univar.py
===================================================================
--- grass/trunk/temporal/t.vect.univar/t.vect.univar.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.vect.univar/t.vect.univar.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -68,11 +68,13 @@
 #%end
 
 import grass.script as grass
-import grass.temporal as tgis
 
+
 ############################################################################
 
 def main():
+    #lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]

Modified: grass/trunk/temporal/t.vect.what.strds/t.vect.what.strds.py
===================================================================
--- grass/trunk/temporal/t.vect.what.strds/t.vect.what.strds.py	2017-01-13 00:41:55 UTC (rev 70356)
+++ grass/trunk/temporal/t.vect.what.strds/t.vect.what.strds.py	2017-01-13 04:01:44 UTC (rev 70357)
@@ -60,7 +60,6 @@
 
 import os
 import grass.script as grass
-import grass.temporal as tgis
 import grass.script.raster as raster
 from grass.exceptions import CalledModuleError
 
@@ -68,6 +67,8 @@
 
 
 def main():
+    # lazy imports
+    import grass.temporal as tgis
 
     # Get the options
     input = options["input"]



More information about the grass-commit mailing list