diff options
author | cce <devnull@localhost> | 2006-03-08 19:45:30 +0000 |
---|---|---|
committer | cce <devnull@localhost> | 2006-03-08 19:45:30 +0000 |
commit | 312f64283c44a3bf10eaab8d2d35fadd9102db49 (patch) | |
tree | 9424a94c61429cd39fea98aa805c801a242e3799 /paste/transaction.py | |
parent | 7bce6520ae2d433d7a8c0c028a01bf51520d1d02 (diff) | |
download | paste-312f64283c44a3bf10eaab8d2d35fadd9102db49.tar.gz |
- updating connection factory to make the environ
an optional parameter
Diffstat (limited to 'paste/transaction.py')
-rw-r--r-- | paste/transaction.py | 5 |
1 files changed, 3 insertions, 2 deletions
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 + |