mailr14010 - in /branches/gui_testing: ./ relax.py relax_warnings.py status.py


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

Header


Content

Posted by edward on July 29, 2011 - 18:38:
Author: bugman
Date: Fri Jul 29 18:38:00 2011
New Revision: 14010

URL: http://svn.gna.org/viewcvs/relax?rev=14010&view=rev
Log:
Merged revisions 14008-14009 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3

........
  r14008 | bugman | 2011-07-29 18:36:30 +0200 (Fri, 29 Jul 2011) | 3 lines
  
  Shifted the pedantic flag into the status object.
........
  r14009 | bugman | 2011-07-29 18:37:15 +0200 (Fri, 29 Jul 2011) | 3 lines
  
  RelaxWarnings now only show a traceback when the pedantic flag is True.
........

Modified:
    branches/gui_testing/   (props changed)
    branches/gui_testing/relax.py
    branches/gui_testing/relax_warnings.py
    branches/gui_testing/status.py

Propchange: branches/gui_testing/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jul 29 18:38:00 2011
@@ -1,1 +1,1 @@
-/1.3:1-13984
+/1.3:1-14009

Modified: branches/gui_testing/relax.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/relax.py?rev=14010&r1=14009&r2=14010&view=diff
==============================================================================
--- branches/gui_testing/relax.py (original)
+++ branches/gui_testing/relax.py Fri Jul 29 18:38:00 2011
@@ -121,7 +121,7 @@
             mode = cmd_mode
 
         # Set up the warning system.
-        relax_warnings.setup(self.pedantic)
+        relax_warnings.setup()
 
         # Show the version number and exit.
         if mode == 'version':
@@ -236,9 +236,8 @@
             status.debug = True
 
         # Pedantic flag.
-        self.pedantic = False
         if options.pedantic:
-            self.pedantic = True
+            status.pedantic = True
 
         # Logging.
         if options.log:

Modified: branches/gui_testing/relax_warnings.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/relax_warnings.py?rev=14010&r1=14009&r2=14010&view=diff
==============================================================================
--- branches/gui_testing/relax_warnings.py (original)
+++ branches/gui_testing/relax_warnings.py Fri Jul 29 18:38:00 2011
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2010 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2011 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -23,13 +23,11 @@
 # Module docstring.
 """Module containing all of the RelaxWarning objects."""
 
-
 # Python module imports.
 import inspect
 import warnings
 
 # relax module imports.
-from relax_errors import BaseError
 from status import Status; status = Status()
 
 
@@ -38,11 +36,10 @@
     """ Replacement for warnings.formatwarning to customise output format."""
 
     # Add the text 'RelaxWarning: ' to the start of the warning message.
-    #if issubclass(category, BaseWarning):
     message = "RelaxWarning: %s\n" % message
 
-    # Print stack-trace in debug mode.
-    if status.debug:
+    # Print stack-trace in pedantic mode.
+    if status.pedantic:
         tb = ""
         for frame in inspect.stack()[4:]:
             file = frame[1]
@@ -63,14 +60,14 @@
     return message
 
 
-def setup(pedantic=False):
+def setup():
     """Set up the warning system."""
 
     # Format warning messages.
     warnings.formatwarning = format
 
     # Set warning filters.
-    if pedantic:
+    if status.pedantic:
         warnings.filterwarnings('error', category=BaseWarning)
     else:
         warnings.filterwarnings('always', category=BaseWarning)
@@ -80,7 +77,7 @@
 # Base class for all warnings.
 ##############################
 
-class BaseWarning(Warning, BaseError):
+class BaseWarning(Warning):
     def __str__(self):
         return self.text
 

Modified: branches/gui_testing/status.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/status.py?rev=14010&r1=14009&r2=14010&view=diff
==============================================================================
--- branches/gui_testing/status.py (original)
+++ branches/gui_testing/status.py Fri Jul 29 18:38:00 2011
@@ -48,6 +48,7 @@
 
             # Initialise some variables.
             self._instance.debug = False
+            self._instance.pedantic = False
             self._instance.install_path = sys.path[0]
 
             # Set up the singleton.




Related Messages


Powered by MHonArc, Updated Fri Jul 29 19:20:02 2011