Procházet zdrojové kódy

pygrass: Module.__call__() - print debug message

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62349 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa před 10 roky
rodič
revize
a793577cdb
1 změnil soubory, kde provedl 6 přidání a 1 odebrání
  1. 6 1
      lib/python/pygrass/modules/interface/module.py

+ 6 - 1
lib/python/pygrass/modules/interface/module.py

@@ -19,7 +19,7 @@ from grass.pygrass.modules.interface.parameter import Parameter
 from grass.pygrass.modules.interface.flag import Flag
 from grass.pygrass.modules.interface.typedict import TypeDict
 from grass.pygrass.modules.interface.read import GETFROMTAG, DOC
-
+from grass.pygrass.messages import Messenger
 
 class ParallelModuleQueue(object):
     """This class is designed to run an arbitrary number of pygrass Module
@@ -337,6 +337,8 @@ class Module(object):
     and keyword arguments to the grass module.
     """
     def __init__(self, cmd, *args, **kargs):
+        self._msgr = Messenger()
+        
         if isinstance(cmd, unicode):
             self.name = str(cmd)
         elif isinstance(cmd, str):
@@ -416,9 +418,12 @@ class Module(object):
         plus some extra parameters that are: run_, stdin_, stdout_, stderr_,
         env_ and finish_.
         """
+        self._msgr.debug(1, "Module.__call__(): %s" % (self.get_bash()))
+        
         if not args and not kargs:
             self.run()
             return self
+        
         #
         # check for extra kargs, set attribute and remove from dictionary
         #