def openfile(self, conn, oid, mode='rw'): f = PgLargeObject(conn.conn, int(oid)) f.open(mode) return f
def file(self, conn): f = conn.createfile('rw') oid = int(f.name) f = PgLargeObject(conn.conn, oid) f.open('rw') return f