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

Uli Fouquet uli at gnufix.de
Sun Aug 10 22:04:37 EDT 2008


Log message for revision 89616:
  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-11 02:04:25 UTC (rev 89615)
+++ zope.introspector/trunk/src/zope/introspector/code.txt	2008-08-11 02:04:36 UTC (rev 89616)
@@ -183,3 +183,29 @@
   >>> sorted(list(info.getSubPackages()), key=lambda x: x.dotted_name)
   [<ModuleInfo object for 'zope.annotation'>,
    ..., <ModuleInfo object for 'zope.traversing'>]
+
+Files
+=====
+
+Files are simple representations of text files contained in a
+package. Currently supported are .txt, .rst and .zcml files.
+
+A ``File`` representation can be created by passing the dotted name of
+the containing package and the filename::
+
+  >>> from zope.introspector.code import File
+  >>> file_obj = File('zope.introspector', 'README.txt')
+  >>> file_obj
+  <zope.introspector.code.File object at 0x...>
+
+File objects provide their dotted name, their filename and their
+filesystem path as attributes::
+
+  >>> file_obj.dotted_name
+  'zope.introspector'
+
+  >>> file_obj.name
+  'README.txt'
+
+  >>> pnorm(file_obj.path)
+  '/...zope/introspector/README.txt'



More information about the Checkins mailing list