浏览代码

pygrass: Module.__call__() - print debug message

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62348 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 年之前
父节点
当前提交
def0b520ca
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      lib/python/pygrass/modules/interface/module.py

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

@@ -96,7 +96,7 @@ from grass.pygrass.modules.interface.parameter import Parameter
 from grass.pygrass.modules.interface.flag import Flag
 from grass.pygrass.modules.interface.flag import Flag
 from grass.pygrass.modules.interface.typedict import TypeDict
 from grass.pygrass.modules.interface.typedict import TypeDict
 from grass.pygrass.modules.interface.read import GETFROMTAG, DOC
 from grass.pygrass.modules.interface.read import GETFROMTAG, DOC
-
+from grass.pygrass.messages import Messenger
 
 
 class ParallelModuleQueue(object):
 class ParallelModuleQueue(object):
     """This class is designed to run an arbitrary number of pygrass Module
     """This class is designed to run an arbitrary number of pygrass Module
@@ -274,6 +274,8 @@ class Module(object):
     and keyword arguments to the grass module.
     and keyword arguments to the grass module.
     """
     """
     def __init__(self, cmd, *args, **kargs):
     def __init__(self, cmd, *args, **kargs):
+        self._msgr = Messenger()
+        
         if isinstance(cmd, unicode):
         if isinstance(cmd, unicode):
             self.name = str(cmd)
             self.name = str(cmd)
         elif isinstance(cmd, str):
         elif isinstance(cmd, str):
@@ -348,9 +350,12 @@ class Module(object):
         self.__call__.__func__.__doc__ = self.__doc__
         self.__call__.__func__.__doc__ = self.__doc__
 
 
     def __call__(self, *args, **kargs):
     def __call__(self, *args, **kargs):
+        self._msgr.debug(1, "Module.__call__(): %s" % (self.get_bash()))
+        
         if not args and not kargs:
         if not args and not kargs:
             self.run()
             self.run()
             return
             return
+        
         #
         #
         # check for extra kargs, set attribute and remove from dictionary
         # check for extra kargs, set attribute and remove from dictionary
         #
         #