[Zope3-checkins] CVS: Zope3/src/zope/app/apidoc - utilities.py:1.6

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Mar 29 10:08:27 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/apidoc
In directory cvs.zope.org:/tmp/cvs-serv21045/src/zope/app/apidoc

Modified Files:
	utilities.py 
Log Message:


Added new relativisePath() method, which converts absolute paths to Zope 3
source tree relative paths.




=== Zope3/src/zope/app/apidoc/utilities.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/apidoc/utilities.py:1.5	Sun Mar 28 18:39:24 2004
+++ Zope3/src/zope/app/apidoc/utilities.py	Mon Mar 29 10:08:26 2004
@@ -18,7 +18,9 @@
 import re
 import types
 import inspect
+from os.path import dirname
 
+import zope
 from zope.interface import implements, implementedBy
 from zope.proxy import removeAllProxies
 from zope.security.checker import getCheckerForInstancesOf, Global
@@ -32,6 +34,12 @@
     r'(?sm)^<html.*<body.*?>\n(.*)</body>\n</html>\n')
 
 _marker = object()
+
+BASEDIR = dirname(dirname(dirname(zope.__file__)))
+
+def relativizePath(path):
+    return path.replace(BASEDIR, 'Zope3')
+
 
 class ReadContainerBase:
     """Base for IReadContainer objects.




More information about the Zope3-Checkins mailing list