Kaydet (Commit) f6cdcd50 authored tarafından Greg Ward's avatar Greg Ward

Added 'warn' method.

üst 7eca8e50
...@@ -9,7 +9,7 @@ lines, and joining lines with backslashes.""" ...@@ -9,7 +9,7 @@ lines, and joining lines with backslashes."""
__revision__ = "$Id$" __revision__ = "$Id$"
from types import * from types import *
import os, string, re import sys, os, string, re
class TextFile: class TextFile:
...@@ -67,6 +67,15 @@ class TextFile: ...@@ -67,6 +67,15 @@ class TextFile:
self.current_line = None 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): def readline (self):
buildup_line = '' 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