't.open(file, rw) returns a pipe or file object open for
reading or writing; the file is the other end of the pipeline.'

def open(self, file, rw):

    if (rw == 'r'):
        return self.open_r(file)
    if (rw == 'w'):
        return self.open_w(file)
    raise ValueError, ("Template.open:    rw    must    be    'r'    or    'w',    not    %r" % (rw,))
