add opencollective metadata and index field

This commit is contained in:
Marcus 2020-03-10 14:56:03 +00:00
parent b8ddc43f95
commit 9d24f2e4a7
10 changed files with 21 additions and 1 deletions

View file

@ -71,6 +71,7 @@ app_fields = set([
'Donate',
'FlattrID',
'LiberapayID',
'OpenCollective',
'Bitcoin',
'Litecoin',
'Name',
@ -114,6 +115,7 @@ yaml_app_field_order = [
'Donate',
'FlattrID',
'LiberapayID',
'OpenCollective',
'Bitcoin',
'Litecoin',
'\n',
@ -173,6 +175,7 @@ class App(dict):
self.Donate = None
self.FlattrID = None
self.LiberapayID = None
self.OpenCollective = None
self.Bitcoin = None
self.Litecoin = None
self.Name = None
@ -448,6 +451,10 @@ valuetypes = {
r'^[0-9]+$',
['LiberapayID']),
FieldValidator("Open Collective",
r'^[0-9a-z-]+$',
['OpenCollective']),
FieldValidator("HTTP link",
r'^http[s]?://',
["WebSite", "SourceCode", "IssueTracker", "Translation", "Changelog", "Donate"]),
@ -1464,6 +1471,7 @@ def write_plaintext_metadata(mf, app, w_comment, w_field, w_build):
w_field_nonempty('Donate')
w_field_nonempty('FlattrID')
w_field_nonempty('LiberapayID')
w_field_nonempty('OpenCollective')
w_field_nonempty('Bitcoin')
w_field_nonempty('Litecoin')
mf.write('\n')