From f6cdcd509df1681b2f27e8a4f9130159c8e13723 Mon Sep 17 00:00:00 2001 From: Greg Ward Date: Mon, 18 Jan 1999 17:08:16 +0000 Subject: Added 'warn' method. --- Lib/distutils/text_file.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Lib/distutils/text_file.py b/Lib/distutils/text_file.py index 9fff941..9e1a73b 100644 --- a/Lib/distutils/text_file.py +++ b/Lib/distutils/text_file.py @@ -9,7 +9,7 @@ lines, and joining lines with backslashes.""" __revision__ = "$Id$" from types import * -import os, string, re +import sys, os, string, re class TextFile: @@ -67,6 +67,15 @@ class TextFile: self.current_line = None + def warn (self, msg): + sys.stderr.write (self.filename + ", ") + if type (self.current_line) is ListType: + sys.stderr.write ("lines %d-%d: " % tuple (self.current_line)) + else: + sys.stderr.write ("line %d: " % self.current_line) + sys.stderr.write (msg + "\n") + + def readline (self): buildup_line = '' -- cgit v0.12