Author: bugman Date: Tue Feb 27 05:58:03 2007 New Revision: 3041 URL: http://svn.gna.org/viewcvs/relax?rev=3041&view=rev Log: The Debug flag and Relax instance are placed as globals in the 'errors' and 'warnings' modules. See https://mail.gna.org/public/relax-devel/2007-02/msg00012.html (Message-id: <7f080ed10702261928q4669285ekae60eee4631c1745@xxxxxxxxxxxxxx>) and https://mail.gna.org/public/relax-devel/2007-02/msg00011.html (Message-id: <1172508127.8066.147.camel@mrspell>) for discussions. Modified: branches/error_import/relax Modified: branches/error_import/relax URL: http://svn.gna.org/viewcvs/relax/branches/error_import/relax?rev=3041&r1=3040&r2=3041&view=diff ============================================================================== --- branches/error_import/relax (original) +++ branches/error_import/relax Tue Feb 27 05:58:03 2007 @@ -66,7 +66,7 @@ # relax modules. from colour import Colour from data.main import Data -from errors import RelaxErrors, RelaxWarnings +import errors from io import IO from generic_fns.main import Generic from prompt.gpl import gpl @@ -77,6 +77,7 @@ from test_suite.unit_tests.unit_test_runner import Run_unit_tests from thread_classes import Threading, ThreadData import version +import warnings sys.path.append(sys.path[0]) sys.path[0] = '.' @@ -96,18 +97,12 @@ # Store the operating system name. self.platform = platform.uname()[0] - # Set up the program internal errors. - RelaxErrors(self) - # Debugging flag (default is off). self.relax.Debug = 0 - + # Pedantic flag (default is off). self.relax.Pedantic = 0 - # Set up the program internal errors. - RelaxErrors(self) - # Set the program introduction string to nothing. self.intro_string = None @@ -137,10 +132,13 @@ # Process the command line arguments and determine the relax mode. mode, log_file, tee_file = self.arguments() - - # Initialise the warnings sytem. - RelaxWarnings() - + + # Set up the RelaxError and RelaxWarning global variables. + errors.Debug = self.relax.Debug + errors.relax = self.relax + warnings.Debug = warnings.relax.Debug + warnings.relax = warnings.relax + # Show the version number and exit. if mode == 'version': print 'relax ' + self.version @@ -234,7 +232,7 @@ # Debugging flag. if options.debug: self.relax.Debug = 1 - + # Pedantic flag. if options.pedantic: self.relax.Pedantic = 1