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

Jim Fulton jim@zope.com
Wed, 13 Nov 2002 15:23:53 -0500


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

Modified Files:
      Tag: Zope3-Bangalore-TTW-Branch
	IIntrospector.py Introspector.py 
Log Message:
fixed DOS line endings

=== Zope3/lib/python/Zope/App/OFS/Introspector/IIntrospector.py 1.2.12.1 => 1.2.12.2 ===
--- Zope3/lib/python/Zope/App/OFS/Introspector/IIntrospector.py:1.2.12.1	Fri Oct 25 06:32:50 2002
+++ Zope3/lib/python/Zope/App/OFS/Introspector/IIntrospector.py	Wed Nov 13 15:23:22 2002
@@ -15,37 +15,37 @@
 
 class IIntrospector(Interface):
     """An interface for introspecting a component"""
-
-    def isInterface():
-        "Checks if the context is class or interface"
-        
+
+    def isInterface():
+        "Checks if the context is class or interface"
+        
     def setRequest(request):
-        """sets the request"""
+        """sets the request"""
         
     def getClass():
-        """Returns the class name"""
-
-    def getBaseClassNames():
-        """Returns the names of the classes"""
-        
-    def getModule():
+        """Returns the class name"""
+
+    def getBaseClassNames():
+        """Returns the names of the classes"""
+        
+    def getModule():
         """Returns the module name of the class"""
     
     def getDocString():
         """Returns the description of the class"""
         
     def getInterfaces():
-        """Returns interfaces implemented by this class"""
-
-    def getInterfaceNames():
+        """Returns interfaces implemented by this class"""
+
+    def getInterfaceNames():
         """Returns the name of the interface"""
         
     def getInterfaceDetails():
-        """Returns the entire documentation in the interface"""
-
-    def getExtends():
-        """Returns all the class extended up to the top most level"""
-
-    def getInterfaceConfiguration():
-        """Returns details for a interface configuration"""        
+        """Returns the entire documentation in the interface"""
+
+    def getExtends():
+        """Returns all the class extended up to the top most level"""
+
+    def getInterfaceConfiguration():
+        """Returns details for a interface configuration"""        
 


=== Zope3/lib/python/Zope/App/OFS/Introspector/Introspector.py 1.2.12.2 => 1.2.12.3 ===
--- Zope3/lib/python/Zope/App/OFS/Introspector/Introspector.py:1.2.12.2	Tue Oct 29 07:28:16 2002
+++ Zope3/lib/python/Zope/App/OFS/Introspector/Introspector.py	Wed Nov 13 15:23:22 2002
@@ -16,10 +16,10 @@
 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
-import string
+from Zope.App.OFS.Services.ServiceManager.INameResolver import INameResolver
+import string
+
 
-
 class Introspector:
     """Introspecs an object"""
     __implements__ = IIntrospector
@@ -28,36 +28,36 @@
     def __init__(self, context):
         self.context = context
         self.request = None
-        self.currentclass = None
-        
-    def isInterface(self):
-        "Checks if the context is class or interface"
-        try:
-            ck = self.context.namesAndDescriptions()
-            return 1
-        except:
-            return 0
+        self.currentclass = None
+        
+    def isInterface(self):
+        "Checks if the context is class or interface"
+        try:
+            ck = self.context.namesAndDescriptions()
+            return 1
+        except:
+            return 0
     
     def setRequest(self, request):
         """sets the request"""
-        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)
-                adapter = getAdapter(servicemanager, INameResolver)
-                self.currentclass = adapter.resolve(name)
-                self.context = self.currentclass
-            else:
-                self.currentclass = self.context
-        else:
-            self.currentclass = self.context.__class__
-            
+        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)
+                adapter = getAdapter(servicemanager, INameResolver)
+                self.currentclass = adapter.resolve(name)
+                self.context = self.currentclass
+            else:
+                self.currentclass = self.context
+        else:
+            self.currentclass = self.context.__class__
+            
 
     def _unpackTuple(self, tuple_obj):
         res=[]
@@ -130,14 +130,14 @@
         """Returns all the class extended up to the top most level"""
         bases = self._unpackTuple((self.currentclass).__bases__)
         return bases
-
-    def getInterfaceConfiguration(self):
-        """Returns details for a interface configuration"""
-        #sm = queryServiceManager(self.context)
-        service = []
-        for name, interface in getServiceDefinitions(self.context):
-            if self.context.extends(interface):
-                service.append(str(name))
-        print service
+
+    def getInterfaceConfiguration(self):
+        """Returns details for a interface configuration"""
+        #sm = queryServiceManager(self.context)
+        service = []
+        for name, interface in getServiceDefinitions(self.context):
+            if self.context.extends(interface):
+                service.append(str(name))
+        print service
         return service