Add Author Name and Author Email fields. (Closes: #90)

This commit is contained in:
Dominik George 2016-01-03 20:49:36 +01:00
parent 622195bf16
commit 7f3434ea50
No known key found for this signature in database
GPG key ID: B79A3C16A0C4F296
8 changed files with 5985 additions and 5920 deletions

View file

@ -62,6 +62,8 @@ app_fields = set([
'Provides',
'Categories',
'License',
'Author Name',
'Author Email',
'Web Site',
'Source Code',
'Issue Tracker',
@ -103,6 +105,8 @@ class App():
self.Provides = None
self.Categories = ['None']
self.License = 'Unknown'
self.AuthorName = None
self.AuthorEmail = None
self.WebSite = ''
self.SourceCode = ''
self.IssueTracker = ''
@ -440,6 +444,10 @@ valuetypes = {
r'^http[s]?://', None,
["WebSite", "SourceCode", "IssueTracker", "Changelog", "Donate"], []),
FieldValidator("Email",
r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$', None,
["AuthorEmail"], []),
FieldValidator("Bitcoin address",
r'^[a-zA-Z0-9]{27,34}$', None,
["Bitcoin"],
@ -1228,6 +1236,8 @@ def write_plaintext_metadata(mf, app, w_comment, w_field, w_build):
w_field_nonempty('Provides')
w_field_always('Categories')
w_field_always('License')
w_field_nonempty('Author Name')
w_field_nonempty('Author Email')
w_field_always('Web Site')
w_field_always('Source Code')
w_field_always('Issue Tracker')

View file

@ -103,7 +103,7 @@ def update_wiki(apps, sortedids, apks):
requiresroot = 'Yes'
else:
requiresroot = 'No'
wikidata += '{{App|id=%s|name=%s|added=%s|lastupdated=%s|source=%s|tracker=%s|web=%s|changelog=%s|donate=%s|flattr=%s|bitcoin=%s|litecoin=%s|license=%s|root=%s}}\n' % (
wikidata += '{{App|id=%s|name=%s|added=%s|lastupdated=%s|source=%s|tracker=%s|web=%s|changelog=%s|donate=%s|flattr=%s|bitcoin=%s|litecoin=%s|license=%s|root=%s|author=%s|email=%s}}\n' % (
appid,
app.Name,
time.strftime('%Y-%m-%d', app.added) if app.added else '',
@ -117,7 +117,9 @@ def update_wiki(apps, sortedids, apks):
app.Bitcoin,
app.Litecoin,
app.License,
requiresroot)
requiresroot,
app.AuthorName,
app.AuthorEmail)
if app.Provides:
wikidata += "This app provides: %s" % ', '.join(app.Summary.split(','))
@ -850,6 +852,8 @@ def make_index(apps, sortedids, apks, repodir, archive, categories):
addElement('source', app.SourceCode, doc, apel)
addElement('tracker', app.IssueTracker, doc, apel)
addElementNonEmpty('changelog', app.Changelog, doc, apel)
addElementNonEmpty('author', app.AuthorName, doc, apel)
addElementNonEmpty('email', app.AuthorEmail, doc, apel)
addElementNonEmpty('donate', app.Donate, doc, apel)
addElementNonEmpty('bitcoin', app.Bitcoin, doc, apel)
addElementNonEmpty('litecoin', app.Litecoin, doc, apel)