chiark / gitweb /
include Author/Contact info from Triple-T Gradle Play Publisher
authorHans-Christoph Steiner <hans@eds.org>
Fri, 14 Apr 2017 10:06:12 +0000 (12:06 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 19 Apr 2017 08:05:24 +0000 (10:05 +0200)
This is just the bare minimum, it adds it to the index, but AuthorPhone
and AuthorWebsite are not yet supported by fdroidclient.  AuthorName is.

#204

fdroidserver/common.py
fdroidserver/update.py

index 6ffb54aec24033fdf0df3bba3de1fa4952158653..8ced40c97a72cd6d7c9cbcbab452908480b52374 100644 (file)
@@ -93,6 +93,7 @@ default_config = {
     'keystore': 'keystore.jks',
     'smartcardoptions': [],
     'char_limits': {
+        'Author': 256,
         'Name': 30,
         'Summary': 80,
         'Description': 4000,
index 4a4da899969cd588b122012a448e223e641ede71..f4480ec12d36a2a0ab1f96e0eb87a60b7ac03c5e 100644 (file)
@@ -574,6 +574,14 @@ def _set_localized_text_entry(app, locale, key, f):
             localized[key] = text
 
 
+def _set_author_entry(app, key, f):
+    limit = config['char_limits']['Author']
+    with open(f) as fp:
+        text = fp.read()[:limit]
+        if len(text) > 0:
+            app[key] = text
+
+
 def copy_triple_t_store_metadata(apps):
     """Include store metadata from the app's source repo
 
@@ -623,6 +631,15 @@ def copy_triple_t_store_metadata(apps):
                         _set_localized_text_entry(app, segments[-1], 'WhatsNew',
                                                   os.path.join(root, f))
                         continue
+                    elif f == 'contactEmail':
+                        _set_author_entry(app, 'AuthorEmail', os.path.join(root, f))
+                        continue
+                    elif f == 'contactPhone':
+                        _set_author_entry(app, 'AuthorPhone', os.path.join(root, f))
+                        continue
+                    elif f == 'contactWebsite':
+                        _set_author_entry(app, 'AuthorWebSite', os.path.join(root, f))
+                        continue
 
                     base, extension = common.get_extension(f)
                     dirname = os.path.basename(root)