Commit 5df8b872 authored by Greg Ward's avatar Greg Ward

Added 'warn' method.

parent d037945b
......@@ -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 = ''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment