[z3-checkins] r41746 - z3/sqlos/trunk/src/sqlos
kobold at codespeak.net
kobold at codespeak.net
Sat Mar 31 15:16:37 CEST 2007
Author: kobold
Date: Sat Mar 31 15:16:32 2007
New Revision: 41746
Modified:
z3/sqlos/trunk/src/sqlos/connection.py
Log:
Cosmetic changes for connection.py.
Modified: z3/sqlos/trunk/src/sqlos/connection.py
==============================================================================
--- z3/sqlos/trunk/src/sqlos/connection.py (original)
+++ z3/sqlos/trunk/src/sqlos/connection.py Sat Mar 31 15:16:32 2007
@@ -47,6 +47,7 @@
conn_cache = ConnectionCache()
+
def clearCacheSubscriber(*args):
"""A subscriber to clear the connection cache at site boundaries.
@@ -70,14 +71,11 @@
>>> clearCacheSubscriber('dummy')
>>> conn_cache.queryConnection('a') is None
True
+
"""
conn_cache.clear()
-class SQLObjectWarning(UserWarning):
- pass
-
-
class ConnectionDescriptor:
def __init__(self, name=None):
@@ -89,14 +87,9 @@
if name is None:
try:
ut = zope.component.getUtility(IConnectionName)
+ name = ut.name
except ComponentLookupError:
- return self
- if ut is None:
- warnings.warn("Couldn't find ISQLConnectionName utility. "
- "Please verify your setup.",
- SQLObjectWarning, 2)
- return
- name = ut.name
+ return None
# try get the connection from the cache, or make a new one
conn = conn_cache.queryConnection(name)
if conn is None:
More information about the z3-checkins
mailing list