Author: bugman Date: Wed Sep 20 08:47:07 2006 New Revision: 2573 URL: http://svn.gna.org/viewcvs/relax?rev=2573&view=rev Log: Removal of the duplicated RelaxWarning formatting function. The removal of this function was decided in the post at https://mail.gna.org/public/relax-devel/2006-09/msg00002.html (Message-id: <1158156403.9972.33.camel@mrspell>). Modified: branches/warning/errors.py Modified: branches/warning/errors.py URL: http://svn.gna.org/viewcvs/relax/branches/warning/errors.py?rev=2573&r1=2572&r2=2573&view=diff ============================================================================== --- branches/warning/errors.py (original) +++ branches/warning/errors.py Wed Sep 20 08:47:07 2006 @@ -610,34 +610,6 @@ self.save_state() -# Warning objects. -################## - -# Replacement for warnings.formatwarning to customise output format. -def format(message, category, filename, lineno): - if issubclass(category, self.BaseWarning): - message = "RelaxWarning: %s\n\n" % message - - if Debug: - tb = "" - for frame in inspect.stack()[4:]: - file = frame[1] - lineNo = frame[2] - func = frame[3] - tb_frame = ' File "%s", line %i, in %s\n' % (file, lineNo, func) - try: - context = frame[4][frame[5]] - except TypeError: - pass - else: - tb_frame = '%s %s\n' % (tb_frame, context.strip()) - tb = tb_frame + tb - tb = "Traceback (most recent call last):\n%s" % tb - message = tb + message - - return message - - # The RelaxWarning system. ########################## @@ -677,6 +649,7 @@ def format(self, message, category, filename, lineno): """ Replacement for warnings.formatwarning to customise output format.""" + # Add the text 'RelaxWarning: ' to the start of the warning message. if issubclass(category, self.BaseWarning): message = "RelaxWarning: %s\n\n" % message @@ -698,6 +671,7 @@ tb = "Traceback (most recent call last):\n%s" % tb message = tb + message + # Return the warning message. return message