Added missing file
This commit is contained in:
parent
7fcdcf9a0d
commit
3ec22fca46
1 changed files with 37 additions and 0 deletions
37
flask_website/listings/releases.py
Normal file
37
flask_website/listings/releases.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
from urlparse import urljoin
|
||||
|
||||
|
||||
server = 'http://pypi.python.org/'
|
||||
download_path = '/packages/source/F/Flask/Flask-%s.tar.gz'
|
||||
detail_path = '/pypi/Flask/%s'
|
||||
|
||||
|
||||
class Release(object):
|
||||
|
||||
def __init__(self, version):
|
||||
self.version = version
|
||||
|
||||
def to_json(self):
|
||||
return dict(version=self.version,
|
||||
download_url=self.download_url,
|
||||
detail_url=self.detail_url)
|
||||
|
||||
@property
|
||||
def download_url(self):
|
||||
return urljoin(server, download_path % self.version)
|
||||
|
||||
@property
|
||||
def detail_url(self):
|
||||
return urljoin(server, detail_path % self.version)
|
||||
|
||||
|
||||
releases = map(Release, [
|
||||
'0.1',
|
||||
'0.2',
|
||||
'0.3',
|
||||
'0.3.1',
|
||||
'0.4',
|
||||
'0.5',
|
||||
'0.5.1',
|
||||
'0.5.2'
|
||||
])
|
||||
Loading…
Add table
Add a link
Reference in a new issue