From 312f64283c44a3bf10eaab8d2d35fadd9102db49 Mon Sep 17 00:00:00 2001 From: cce Date: Wed, 8 Mar 2006 19:45:30 +0000 Subject: - updating connection factory to make the environ an optional parameter --- paste/transaction.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'paste/transaction.py') diff --git a/paste/transaction.py b/paste/transaction.py index 0632058..4f3591b 100644 --- a/paste/transaction.py +++ b/paste/transaction.py @@ -32,7 +32,7 @@ class ConnectionFactory(object): if hasattr(self.module,'PgQuoteString'): self.quote = self.module.PgQuoteString - def __call__(self, environ): + def __call__(self, environ=None): conn = self.module.connect(*self.args,**self.kwargs) conn.__dict__['module'] = self.module conn.__dict__['quote'] = self.quote @@ -72,8 +72,9 @@ __all__ = ['ConnectionFactory','BasicTransactionHandler'] if '__main__' == __name__ and False: from pyPgSQL import PgSQL factory = ConnectionFactory(PgSQL,database="testing") - conn = factory(None) + conn = factory() curr = conn.cursor() curr.execute("SELECT now(), %s" % conn.quote("B'n\\'gles")) (time,bing) = curr.fetchone() print bing, time + -- cgit v1.2.1