make use of settings.CONTENT_TYPES to compute EBOOK_FORMATS

pull/1/head
Raymond Yee 2016-03-07 13:30:40 -08:00
parent c5b7c20593
commit bf914a53de
1 changed files with 1 additions and 6 deletions

View File

@ -937,13 +937,8 @@ def ebooks_in_github_release(repo_owner, repo_name, tag, token=None):
higher rate limit in the GitHub API higher rate limit in the GitHub API
""" """
# epub, mobi, pdf, html, text
# map mimetype to file extension # map mimetype to file extension
EBOOK_FORMATS = {'application/epub+zip':'epub', EBOOK_FORMATS = dict([(v,k) for (k,v) in settings.CONTENT_TYPES.items()])
'application/x-mobipocket-ebook': 'mobi',
'application/pdf': 'pdf',
'text/plain': 'text',
'text/html':'html'}
if token is not None: if token is not None:
gh = login(token=token) gh = login(token=token)