[cig-commits] r21735 - short/3D/PyLith/trunk/pylith/apps

brad at geodynamics.org brad at geodynamics.org
Fri Apr 5 15:21:56 PDT 2013


Author: brad
Date: 2013-04-05 15:21:56 -0700 (Fri, 05 Apr 2013)
New Revision: 21735

Modified:
   short/3D/PyLith/trunk/pylith/apps/PyLithApp.py
Log:
Add flag for turning on python debugger.

Modified: short/3D/PyLith/trunk/pylith/apps/PyLithApp.py
===================================================================
--- short/3D/PyLith/trunk/pylith/apps/PyLithApp.py	2013-04-05 19:01:31 UTC (rev 21734)
+++ short/3D/PyLith/trunk/pylith/apps/PyLithApp.py	2013-04-05 22:21:56 UTC (rev 21735)
@@ -72,8 +72,9 @@
     typos.meta['tip'] = "Specifies the handling of unknown properties and " \
         "facilities"
     
+    pdbOn = pyre.inventory.bool("start_python_debugger", default=False)
+    pdbOn.meta['tip'] = "Start python debugger at beginning of main()."
 
-
   # PUBLIC METHODS /////////////////////////////////////////////////////
 
   def __init__(self, name="pylithapp"):
@@ -89,6 +90,10 @@
     """
     Run the application.
     """
+    if self.pdbOn:
+          import pdb
+          pdb.set_trace()
+        
     from pylith.utils.profiling import resourceUsageString
     
     self._debug.log(resourceUsageString())
@@ -153,6 +158,7 @@
     self.problem = self.inventory.problem
     self.perfLogger = self.inventory.perfLogger
     self.typos = self.inventory.typos
+    self.pdbOn = self.inventory.pdbOn
 
     import journal
     self._debug = journal.debug(self.name)



More information about the CIG-COMMITS mailing list