[Checkins] SVN: zope.introspector/trunk/src/zope/introspector/code.txt Update tests.

Uli Fouquet uli at gnufix.de
Sun Aug 10 09:39:19 EDT 2008


Log message for revision 89597:
  Update tests.

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

-=-
Modified: zope.introspector/trunk/src/zope/introspector/code.txt
===================================================================
--- zope.introspector/trunk/src/zope/introspector/code.txt	2008-08-10 13:38:50 UTC (rev 89596)
+++ zope.introspector/trunk/src/zope/introspector/code.txt	2008-08-10 13:39:18 UTC (rev 89597)
@@ -52,7 +52,25 @@
 provide subitems and is the fallback for any object type, that cannot
 be determined more exactly.
 
+All ``Code`` objects know about their parents, which comes in handy,
+when building breadcrumbs. The resulting tuple contains the parents
+from the top-most to the actual object. The parents are delivered of
+course as ``Code`` representations or derived::
 
+  >>> code.getParents()
+  (<zope.introspector.code.Package object at 0x...>, <...>)
+
+  >>> [x.dotted_name for x in code.getParents()]
+  ['zope', 'zope.app']
+
+This is also the case with other kinds of objects, that contain a dot
+in their name::
+
+  >>> from zope.introspector.code import File
+  >>> code = File('zope.introspector', 'README.txt')
+  >>> [getattr(x, 'name', x.dotted_name) for x in code.getParents()]
+  ['zope', 'zope.introspector', 'README.txt']
+
 Packages
 ========
 



More information about the Checkins mailing list