# HG changeset patch # User Sylvain Thénault # Date 1267164292 -3600 # Node ID 8ae13d05985012fcce9458aeedab803f01f5bb1d # Parent a1ac5a45314602951392b74f71de2dd0f66010fc [dbapi] no more need to monkey patch this in 3.6: vreg/schema/config are all properly accessed through ._cw diff -r a1ac5a453146 -r 8ae13d059850 dbapi.py --- a/dbapi.py Fri Feb 26 07:03:38 2010 +0100 +++ b/dbapi.py Fri Feb 26 07:04:52 2010 +0100 @@ -31,11 +31,6 @@ except KeyError: return '' -def _fix_cls_attrs(reg, appobject): - appobject.vreg = reg.vreg - appobject.schema = reg.schema - appobject.config = reg.config - def multiple_connections_fix(): """some monkey patching necessary when an application has to deal with several connections to different repositories. It tries to hide buggy class @@ -43,21 +38,6 @@ registries. """ defaultcls = cwvreg.VRegistry.REGISTRY_FACTORY[None] - orig_select_best = defaultcls.orig_select_best = defaultcls._select_best - @monkeypatch(defaultcls) - def _select_best(self, appobjects, *args, **kwargs): - """return an instance of the most specific object according - to parameters - - raise NoSelectableObject if no object apply - """ - for appobjectcls in appobjects: - _fix_cls_attrs(self, appobjectcls) - selected = orig_select_best(self, appobjects, *args, **kwargs) - # redo the same thing on the instance so it won't use equivalent class - # attributes (which may change) - _fix_cls_attrs(self, selected) - return selected etypescls = cwvreg.VRegistry.REGISTRY_FACTORY['etypes'] orig_etype_class = etypescls.orig_etype_class = etypescls.etype_class @@ -74,8 +54,6 @@ return usercls def multiple_connections_unfix(): - defaultcls = cwvreg.VRegistry.REGISTRY_FACTORY[None] - defaultcls.select_best = defaultcls.orig_select_best etypescls = cwvreg.VRegistry.REGISTRY_FACTORY['etypes'] etypescls.etype_class = etypescls.orig_etype_class