[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Introspector - Introspector.py:1.2.12.2

Deb dhazarika@zeomega.com
Tue, 29 Oct 2002 07:28:17 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Introspector
In directory cvs.zope.org:/tmp/cvs-serv32060

Modified Files:
      Tag: Zope3-Bangalore-TTW-Branch
	Introspector.py 
Log Message:



=== Zope3/lib/python/Zope/App/OFS/Introspector/Introspector.py 1.2.12.1 => 1.2.12.2 ===
--- Zope3/lib/python/Zope/App/OFS/Introspector/Introspector.py:1.2.12.1	Fri Oct 25 06:32:50 2002
+++ Zope3/lib/python/Zope/App/OFS/Introspector/Introspector.py	Tue Oct 29 07:28:16 2002
@@ -11,12 +11,12 @@
 # FOR A PARTICULAR PURPOSE.
 # 
 ##############################################################################
-from Interface import Interface
+from Interface import Interface, IInterface
 from Interface.Implements import implements, getImplements
 from IIntrospector import IIntrospector
 from Zope.Proxy.ProxyIntrospection import removeAllProxies
 from Zope.ComponentArchitecture import getServiceManager, getAdapter, queryServiceManager, getServiceDefinitions
-from Zope.App.OFS.Services.ServiceManager.INameResolver import INameResolver
+from Zope.App.OFS.Services.ServiceManager.INameResolver import INameResolver
 import string
 
 
@@ -32,13 +32,21 @@
         
     def isInterface(self):
         "Checks if the context is class or interface"
-        return int(Interface.isImplementedBy(self.context))
+        try:
+            ck = self.context.namesAndDescriptions()
+            return 1
+        except:
+            return 0
     
     def setRequest(self, request):
         """sets the request"""
-        self.request = request
-        path = self.request['PATH_INFO']
+        self.request = request
+        if 'PATH_INFO' in request:
+            path = self.request['PATH_INFO']
+        else:
+            path = ''
         name = path[string.rfind(path, '++module++')+len('++module++'):]
+        name = string.split(name, '/')[0]
         if string.find(path, '++module++') != -1:
             if self.context == Interface and name != 'Interface._Interface.Interface':
                 servicemanager = getServiceManager(self.context)