summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Jones <richard@mechanicalcat.net>2013-02-09 11:02:37 +1100
committerRichard Jones <richard@mechanicalcat.net>2013-02-09 11:02:37 +1100
commitce80d317bc020ae9c61d278904ee7ac3d8f980bc (patch)
treed504c42c7cb26cc95202b85e5633279d9f775440
parent343e515f1d0dafc4f88640a5ee219fadad437614 (diff)
downloaddecorator-ce80d317bc020ae9c61d278904ee7ac3d8f980bc.tar.gz
packages.python.org -> pythonhosted.org
-rw-r--r--config.ini.template3
-rw-r--r--config.py2
-rw-r--r--store.py4
-rw-r--r--templates/pkg_edit.pt6
4 files changed, 9 insertions, 6 deletions
diff --git a/config.ini.template b/config.ini.template
index 5250fdf..6276971 100644
--- a/config.ini.template
+++ b/config.ini.template
@@ -6,6 +6,7 @@ user = pypi
# port = 5432
files_dir = /MacDev/svn.python.org/pypi-pep345/files
docs_dir = /MacDev/svn.python.org/pypi-pep345/docs
+package_docs_url = http://pythonhosted.org/
[webui]
mailhost = mail.python.org
@@ -35,7 +36,7 @@ local-stats = local-stats
global-stats = global-stats
[sentry]
-dsn =
+dsn =
[uwsgi]
wsgi-file = pypi.wsgi
diff --git a/config.py b/config.py
index 634aacd..e4b0a04 100644
--- a/config.py
+++ b/config.py
@@ -31,6 +31,8 @@ class Config:
self.pubsubhubbub = c.get('database', 'pubsubhubbub')
else:
self.pubsubhubbub = None
+ self.package_docs_url = c.get('package_docs_url',
+ 'http://pythonhosted.org')
self.mailhost = c.get('webui', 'mailhost')
self.adminemail = c.get('webui', 'adminemail')
self.replyto = c.get('webui', 'replyto')
diff --git a/store.py b/store.py
index d315c4a..786fc66 100644
--- a/store.py
+++ b/store.py
@@ -1777,7 +1777,7 @@ class Store:
self.userip))
def docs_url(self, name):
- '''Determine the local (packages.python.org) documentation URL, if any.
+ '''Determine the local (pythonhosted.org) documentation URL, if any.
Returns the URL or '' if there are no docs.
'''
@@ -1785,7 +1785,7 @@ class Store:
path = [self.config.database_docs_dir,
name.encode('utf8')] + sub + ['index.html']
if os.path.exists(os.path.join(*path)):
- return '/'.join(['http://packages.python.org', name] + sub)
+ return '/'.join([self.config.package_docs_url, name] + sub)
return ''
def update_upload_times(self):
diff --git a/templates/pkg_edit.pt b/templates/pkg_edit.pt
index 77b1362..2a3cf87 100644
--- a/templates/pkg_edit.pt
+++ b/templates/pkg_edit.pt
@@ -75,7 +75,7 @@ uncheck the button below</p>
enctype="multipart/form-data">
<input type="hidden" name=":action" value="pkg_edit" />
<input type="hidden" name="name" tal:attributes="value data/name" />
-
+
<!-- Apparently, we run TAL in XML mode, so the auto-remove feature
for the checked attribute will not work -->
<input tal:condition="data/autohide" type="checkbox" name="autohide"
@@ -86,8 +86,8 @@ uncheck the button below</p>
</form>
<p>You can now host documentation at
-<a tal:attributes="href string:http://packages.python.org/${data/name}"
-tal:content="string:http://packages.python.org/${data/name}"></a>. To
+<a tal:attributes="href string:http://pythonhosted.org/${data/name}"
+tal:content="string:http://pythonhosted.org/${data/name}"></a>. To
upload documentation, prepare a .zip file that is unpacked into this URL.
Only static pages are supported. The zip file must have a top-level
"index.html".</p>