[Checkins] SVN: zope.app.apidoc/trunk/src/zope/app/apidoc/component.py Prepare for incoming patch: minor style cleanup, move one function around
Christian Theune
ct at gocept.com
Sat Apr 24 06:34:16 EDT 2010
Log message for revision 111336:
Prepare for incoming patch: minor style cleanup, move one function around
Changed:
U zope.app.apidoc/trunk/src/zope/app/apidoc/component.py
-=-
Modified: zope.app.apidoc/trunk/src/zope/app/apidoc/component.py
===================================================================
--- zope.app.apidoc/trunk/src/zope/app/apidoc/component.py 2010-04-24 10:18:55 UTC (rev 111335)
+++ zope.app.apidoc/trunk/src/zope/app/apidoc/component.py 2010-04-24 10:34:16 UTC (rev 111336)
@@ -25,8 +25,7 @@
AdapterRegistration,
HandlerRegistration,
SubscriptionRegistration,
- UtilityRegistration
- )
+ UtilityRegistration)
from zope.i18nmessageid import ZopeMessageFactory as _
from zope.interface import Interface
from zope.interface.interface import InterfaceClass
@@ -42,6 +41,16 @@
EXTENDED_INTERFACE_LEVEL = 2
GENERIC_INTERFACE_LEVEL = 4
+
+def _adapterishRegistrations(registry):
+ for r in registry.registeredAdapters():
+ yield r
+ for r in registry.registeredSubscriptionAdapters():
+ yield r
+ for r in registry.registeredHandlers():
+ yield r
+
+
def getRequiredAdapters(iface, withViews=False):
"""Get adapter registrations where the specified interface is required."""
gsm = getGlobalSiteManager()
@@ -61,13 +70,6 @@
if iface.isOrExtends(required_iface):
yield reg
-def _adapterishRegistrations(registry):
- for r in registry.registeredAdapters():
- yield r
- for r in registry.registeredSubscriptionAdapters():
- yield r
- for r in registry.registeredHandlers():
- yield r
def getProvidedAdapters(iface, withViews=False):
"""Get adapter registrations where this interface is provided."""
@@ -177,6 +179,7 @@
return {'module': getattr(iface, '__module__', _('<unknown>')),
'name': getattr(iface, '__name__', _('<unknown>'))}
+
def getInterfaceInfoDictionary(iface):
"""Return a PT-friendly info dictionary for an interface."""
if isinstance(iface, zope.interface.declarations.Implements):
@@ -194,6 +197,7 @@
'module': type.__module__,
'url': isReferencable(path) and path.replace('.', '/') or None}
+
def getSpecificationInfoDictionary(spec):
"""Return an info dictionary for one specification."""
info = {'isInterface': False, 'isType': False}
@@ -205,6 +209,7 @@
info['isType'] = True
return info
+
def getAdapterInfoDictionary(reg):
"""Return a PT-friendly info dictionary for an adapter registration."""
factory = getRealFactory(reg.factory)
@@ -273,7 +278,7 @@
# Determine the URL
if isinstance(component, InterfaceClass):
- url = 'Interface/%s' %path
+ url = 'Interface/%s' % path
else:
url = None
if isReferencable(path):
More information about the checkins
mailing list