From 4d668e4ed65189856ae0170041045d75055efe7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 31 Dec 2013 11:57:35 +0100 Subject: [PATCH] Add Dogecoin support, some None fixes --- fdroidserver/metadata.py | 8 ++++++++ fdroidserver/update.py | 17 ++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 337a7d4d..07a0cd3f 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -93,6 +93,11 @@ valuetypes = { [ "Litecoin" ], [ ]), + 'dogecoin' : FieldType("Dogecoin address", + r'^D[a-zA-Z0-9]{33}$', None, + [ "Dogecoin" ], + [ ]), + 'Bool' : FieldType("Boolean", ['Yes', 'No'], None, [ "Requires Root" ], @@ -485,6 +490,7 @@ def parse_metadata(metafile): thisinfo['FlattrID'] = None thisinfo['Bitcoin'] = None thisinfo['Litecoin'] = None + thisinfo['Dogecoin'] = None thisinfo['Disabled'] = None thisinfo['AntiFeatures'] = None thisinfo['Archive Policy'] = None @@ -657,6 +663,8 @@ def write_metadata(dest, app): writefield('Bitcoin') if app['Litecoin']: writefield('Litecoin') + if app['Dogecoin']: + writefield('Dogecoin') mf.write('\n') if app['Name']: writefield('Name') diff --git a/fdroidserver/update.py b/fdroidserver/update.py index b1393b82..aa606a7e 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -56,7 +56,7 @@ def update_wiki(apps, apks): if app['AntiFeatures']: for af in app['AntiFeatures'].split(','): wikidata += '{{AntiFeature|' + af + '}}\n' - wikidata += '{{App|id=%s|name=%s|added=%s|lastupdated=%s|source=%s|tracker=%s|web=%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|donate=%s|flattr=%s|bitcoin=%s|litecoin=%s|dogecoin=%s|license=%s|root=%s}}\n'%( app['id'], app['Name'], time.strftime('%Y-%m-%d', app['added']) if 'added' in app else '', @@ -68,6 +68,7 @@ def update_wiki(apps, apks): app['FlattrID'], app['Bitcoin'], app['Litecoin'], + app['Dogecoin'], app['License'], app.get('Requires Root', 'No')) @@ -484,7 +485,7 @@ def make_index(apps, apks, repodir, archive, categories): addElement('description', config['repo_description'], doc, repoel) repoel.setAttribute("timestamp", str(int(time.time()))) - if config['repo_keyalias'] is not None: + if config['repo_keyalias']: # Generate a certificate fingerprint the same way keytool does it # (but with slightly different formatting) @@ -538,7 +539,7 @@ def make_index(apps, apks, repodir, archive, categories): addElement('lastupdated', time.strftime('%Y-%m-%d', app['lastupdated']), doc, apel) addElement('name', app['Name'], doc, apel) addElement('summary', app['Summary'], doc, apel) - if app['icon'] is not None: + if app['icon']: addElement('icon', app['icon'], doc, apel) def linkres(link): for app in apps: @@ -558,13 +559,15 @@ def make_index(apps, apks, repodir, archive, categories): addElement('web', app['Web Site'], doc, apel) addElement('source', app['Source Code'], doc, apel) addElement('tracker', app['Issue Tracker'], doc, apel) - if app['Donate'] is not None: + if app['Donate']: addElement('donate', app['Donate'], doc, apel) - if app['Bitcoin'] is not None: + if app['Bitcoin']: addElement('bitcoin', app['Bitcoin'], doc, apel) - if app['Litecoin'] is not None: + if app['Litecoin']: addElement('litecoin', app['Litecoin'], doc, apel) - if app['FlattrID'] is not None: + if app['Dogecoin']: + addElement('dogecoin', app['Dogecoin'], doc, apel) + if app['FlattrID']: addElement('flattr', app['FlattrID'], doc, apel) # These elements actually refer to the current version (i.e. which