'Construct a new TextFile object.  At least one of \'filename\'
(a string) and \'file\' (a file-like object) must be supplied.
They keyword argument options are described above and affect
the values returned by \'readline()\'.'

def __init__(self, filename=None, file=None, **options):

    if ((filename is None) and (file is None)):
        raise RuntimeError, "you    must    supply    either    or    both    of    'filename'    and    'file'"
    for opt in self.default_options.keys():
        if (opt in options):
            setattr(self, opt, options[opt])
        else:
            setattr(self, opt, self.default_options[opt])
    for opt in options.keys():
        if (opt not in self.default_options):
            raise KeyError, ("invalid    TextFile    option    '%s'" % opt)
    if (file is None):
        self.open(filename)
    else:
        self.filename = filename
        self.file = file
        self.current_line = 0
    self.linebuf = []
