[Checkins] SVN: zope.introspector/trunk/src/zope/introspector/code.py Remove getParents functionality.

Uli Fouquet uli at gnufix.de
Sun Aug 10 21:43:22 EDT 2008


Log message for revision 89613:
  Remove getParents functionality.
  
  It was used only for computing breadcrumbs in UIs, which does
  not make much sense with the raw code objects, because they are
  not located by themselves.
  

Changed:
  U   zope.introspector/trunk/src/zope/introspector/code.py

-=-
Modified: zope.introspector/trunk/src/zope/introspector/code.py
===================================================================
--- zope.introspector/trunk/src/zope/introspector/code.py	2008-08-11 01:39:03 UTC (rev 89612)
+++ zope.introspector/trunk/src/zope/introspector/code.py	2008-08-11 01:43:22 UTC (rev 89613)
@@ -33,14 +33,6 @@
     def __init__(self, dotted_name):
         self.dotted_name = dotted_name
 
-    def getParents(self):
-        dotted_name = self.dotted_name
-        parts = dotted_name.split('.')
-        result = [Package(parts[0]),]
-        for part in parts[1:]:
-            result.append(result[-1][part])
-        return tuple(result)
-
 class PackageOrModule(Code):
     def __init__(self, dotted_name):
         super(PackageOrModule, self).__init__(dotted_name)
@@ -145,14 +137,6 @@
         super(File, self).__init__(dotted_name)
         self.name = name
 
-    def getParents(self):
-        """Get the parents tuple with the filename appended.
-        """
-        # Files don't store their own name in the dotted_name.
-        result = list(super(File, self).getParents())
-        result.append(self)
-        return tuple(result)
-
     def exists(self):
         """Check whether the file is a file we want to consider."""
         module_info = module_info_from_dotted_name(self.dotted_name)



More information about the Checkins mailing list