[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/static.py
Finally got a complete run. Over 23000 links,
in 5900 seconds. It is 264
Stephan Richter
srichter at cosmos.phy.tufts.edu
Wed Oct 26 17:17:28 EDT 2005
Log message for revision 39656:
Finally got a complete run. Over 23000 links, in 5900 seconds. It is 264
MB large.
Changed:
U Zope3/trunk/src/zope/app/apidoc/static.py
-=-
Modified: Zope3/trunk/src/zope/app/apidoc/static.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/static.py 2005-10-26 21:06:09 UTC (rev 39655)
+++ Zope3/trunk/src/zope/app/apidoc/static.py 2005-10-26 21:17:27 UTC (rev 39656)
@@ -93,14 +93,23 @@
def isLocalURL(url):
"""Determine whether the passed in URL is local and accessible."""
+ # Javascript function call
if url.startswith('javascript:'):
return False
+ # Mail Link
if url.startswith('mailto:'):
return False
+ # External Link
if url.startswith('http://') and not url.startswith(URL):
return False
return True
+def isApidocLink(url):
+ if url.startswith(URL+'++apidoc++/'):
+ return True
+ if url.startswith(URL+'@@/'):
+ return True
+ return False
class StaticAPODoc(object):
"""Static API doc Maker"""
@@ -229,11 +238,11 @@
link.absolute_url = completeURL(cleanURL(link.absolute_url))
# Add link to the queue
if link.absolute_url not in self.visited:
- if isLocalURL(link.url):
+ if isLocalURL(link.url) and isApidocLink(link.absolute_url):
self.linkQueue.insert(0, link)
# Rewrite URLs
- if isLocalURL(link.url):
+ if isLocalURL(link.url) and isApidocLink(link.absolute_url):
parts = ['..']*len(segments)
parts.append(link.absolute_url.replace(URL, ''))
contents = contents.replace(link.url, '/'.join(parts))
More information about the Zope3-Checkins
mailing list