mailr22769 - in /trunk: prompt/interpreter.py relax.py status.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on April 15, 2014 - 16:30:
Author: bugman
Date: Tue Apr 15 16:30:28 2014
New Revision: 22769

URL: http://svn.gna.org/viewcvs/relax?rev=22769&view=rev
Log:
Created the new '-r' or '--traceback' relax command line option.

When supplied, then stack tracebacks will be shown for all RelaxWarnings and 
RelaxErrors.  This
allows for finer debugging control.


Modified:
    trunk/prompt/interpreter.py
    trunk/relax.py
    trunk/status.py

Modified: trunk/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22769&r1=22768&r2=22769&view=diff
==============================================================================
--- trunk/prompt/interpreter.py (original)
+++ trunk/prompt/interpreter.py Tue Apr 15 16:30:28 2014
@@ -500,7 +500,7 @@
         # Nice output for the user.
         else:
             # Print the scary traceback normally hidden from the user.
-            if status.debug:
+            if status.debug or status.traceback:
                 self.showtraceback()
 
             # Print the RelaxError message line.

Modified: trunk/relax.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/relax.py?rev=22769&r1=22768&r2=22769&view=diff
==============================================================================
--- trunk/relax.py      (original)
+++ trunk/relax.py      Tue Apr 15 16:30:28 2014
@@ -308,6 +308,7 @@
         group = OptionGroup(parser, 'Debugging options')
         group.add_option('-d', '--debug', action='store_true', dest='debug', 
default=0, help='enable debugging output')
         group.add_option('-e', '--escalate', action='store_true', 
dest='escalate', default=0, help='escalate all warnings to errors')
+        group.add_option('-r', '--traceback', action='store_true', 
dest='traceback', default=0, help='show stack tracebacks on all RelaxErrors 
and RelaxWarnings')
         group.add_option('--numpy-raise', action='store_true', 
dest='numpy_raise', default=0, help='convert numpy warnings to errors')
         parser.add_option_group(group)
 
@@ -324,6 +325,11 @@
         if options.escalate:
             lib.warnings.ESCALATE = True
             lib.errors.ESCALATE = True
+
+        # Traceback flag.
+        if options.traceback:
+            status.traceback = True
+            lib.warnings.TRACEBACK = True
 
         # Script prompt interactive inspection flag.
         if options.prompt:

Modified: trunk/status.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/status.py?rev=22769&r1=22768&r2=22769&view=diff
==============================================================================
--- trunk/status.py     (original)
+++ trunk/status.py     Tue Apr 15 16:30:28 2014
@@ -52,6 +52,7 @@
 
             # Initialise some variables.
             self._instance.debug = False
+            self._instance.traceback = False
             self._instance.prompt = False
             self._instance.test_mode = False
             self._instance.uf_intro = False




Related Messages


Powered by MHonArc, Updated Tue Apr 15 16:40:02 2014