[Checkins]
SVN: zope.introspector/branches/ulif-grokui-integration/src/zope/introspector/
Update infoproviders and objectinfos to also accept dotted
names for object identification.
Uli Fouquet
uli at gnufix.de
Fri Jul 18 15:44:27 EDT 2008
Log message for revision 88536:
Update infoproviders and objectinfos to also accept dotted names for object identification.
Changed:
U zope.introspector/branches/ulif-grokui-integration/src/zope/introspector/infoproviders.py
U zope.introspector/branches/ulif-grokui-integration/src/zope/introspector/objectinfo.py
-=-
Modified: zope.introspector/branches/ulif-grokui-integration/src/zope/introspector/infoproviders.py
===================================================================
--- zope.introspector/branches/ulif-grokui-integration/src/zope/introspector/infoproviders.py 2008-07-18 19:43:20 UTC (rev 88535)
+++ zope.introspector/branches/ulif-grokui-integration/src/zope/introspector/infoproviders.py 2008-07-18 19:44:26 UTC (rev 88536)
@@ -23,20 +23,20 @@
class SimpleDescriptionProvider(DescriptionProvider):
name = 'simple'
priority(1001)
- def getDescription(self, obj, *args, **kw):
- return IObjectInfo(obj)
+ def getDescription(self, obj, dotted_name=None, **kw):
+ return ObjectInfo(obj, dotted_name=dotted_name)
- def canHandle(self, obj, *args, **kw):
+ def canHandle(self, obj, dotted_name=None, **kw):
return True
class PackageDescriptionProvider(DescriptionProvider):
name = 'package'
priority(1000)
- def getDescription(self, obj, *args, **kw):
- return PackageInfo(obj)
+ def getDescription(self, obj, dotted_name=None, **kw):
+ return PackageInfo(obj, dotted_name)
- def canHandle(self, obj, *args, **kw):
+ def canHandle(self, obj=None, dotted_name=None, **kw):
if not inspect.ismodule(obj):
return False
info = martian.scan.module_info_from_module(obj)
Modified: zope.introspector/branches/ulif-grokui-integration/src/zope/introspector/objectinfo.py
===================================================================
--- zope.introspector/branches/ulif-grokui-integration/src/zope/introspector/objectinfo.py 2008-07-18 19:43:20 UTC (rev 88535)
+++ zope.introspector/branches/ulif-grokui-integration/src/zope/introspector/objectinfo.py 2008-07-18 19:44:26 UTC (rev 88536)
@@ -24,10 +24,13 @@
class ObjectInfo(grok.Adapter):
grok.implements(IObjectInfo)
grok.context(Interface)
+
+ dotted_name = None
- def __init__(self, obj):
+ def __init__(self, obj, dotted_name=None):
self.obj = obj
-
+ self.dotted_name = dotted_name
+
def getType(self):
return type(self.obj)
More information about the Checkins
mailing list