[Pypi-checkins] r805 - in trunk/pypi: . templates
richard
python-checkins at python.org
Sat Jul 24 17:14:13 CEST 2010
Author: richard
Date: Sat Jul 24 17:14:12 2010
New Revision: 805
Modified:
trunk/pypi/templates/display.pt
trunk/pypi/webui.py
Log:
link to docs
Modified: trunk/pypi/templates/display.pt
==============================================================================
--- trunk/pypi/templates/display.pt (original)
+++ trunk/pypi/templates/display.pt Sat Jul 24 17:14:12 2010
@@ -96,6 +96,11 @@
<span tal:content="data/release/maintainer" />
</li>
+ <li tal:condition="data/docs | nothing">
+ <strong>Documentation:</strong>
+ <a tal:attributes="href data/docs" tal:content="data/docs" />
+ </li>
+
<!-- The <th> elements below are a terrible terrible hack for setuptools -->
<li tal:condition="data/release/home_page | nothing">
<strong>Home Page:</strong>
Modified: trunk/pypi/webui.py
==============================================================================
--- trunk/pypi/webui.py (original)
+++ trunk/pypi/webui.py Sat Jul 24 17:14:12 2010
@@ -1356,6 +1356,12 @@
return result
comments = "".join(render_comments(hcomments, True))
+ docs = ''
+ for sub in [[], ['html']]:
+ path = [self.config.database_docs_dir, name] + sub + ['index.html']
+ if os.path.exists(os.path.join(path)):
+ docs = '/'.join(['http://packages.python.org', name] + sub)
+
self.write_template('display.pt',
name=name, version=version, release=release,
description=release.get('summary') or name,
@@ -1366,6 +1372,7 @@
obsoletes=values('obsoletes'),
has_rated=has_rated,
latest_rating=latest_rating,
+ docs=docs,
sum_ratings=total,
nr_ratings=len(ratings),
tally_ratings=tally,
More information about the Pypi-checkins
mailing list