Author: bugman Date: Tue Feb 27 05:39:14 2007 New Revision: 3038 URL: http://svn.gna.org/viewcvs/relax?rev=3038&view=rev Log: Added the relax and Debug global varibles to the error module. These changes were suggested at https://mail.gna.org/public/relax-devel/2007-02/msg00013.html (Message-id: <7f080ed10702262013v1242bbc9y6ba245f8aa7c5275@xxxxxxxxxxxxxx>). Modified: branches/error_import/errors.py Modified: branches/error_import/errors.py URL: http://svn.gna.org/viewcvs/relax/branches/error_import/errors.py?rev=3038&r1=3037&r2=3038&view=diff ============================================================================== --- branches/error_import/errors.py (original) +++ branches/error_import/errors.py Tue Feb 27 05:39:14 2007 @@ -20,10 +20,12 @@ # # ############################################################################### -import __builtin__ -from re import match -from types import ClassType import time + + +# Global variables. +relax = None +Debug = False @@ -38,9 +40,17 @@ def save_state(self): """Function for saving the program state.""" + # Dummy function. + if not relax: + return + + # Append the date and time to the save file. now = time.localtime() file_name = "relax_state_%i%02i%02i_%02i%02i%02i" % (now[0], now[2], now[1], now[3], now[4], now[5]) - self._relax.interpreter._State.save(file_name) + + # Save the program state. + relax.interpreter._State.save(file_name) + # Standard errors.