chiark / gitweb /
rename lastupdated to lastUpdated to match fdroid client
authorHans-Christoph Steiner <hans@eds.org>
Mon, 28 Nov 2016 20:17:22 +0000 (21:17 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 28 Feb 2017 11:08:04 +0000 (12:08 +0100)
This lets index-v1 be parsed directly into class instances because the
field/instance var names match exactly.  The original index v0 element
must retain the 'lastupdated' name for backwards compatibility.

fdroidserver/metadata.py
fdroidserver/update.py
tests/metadata/dump/org.adaway.yaml
tests/metadata/dump/org.smssecure.smssecure.yaml
tests/metadata/dump/org.videolan.vlc.yaml

index a13e3945537a284fac1f49fd7233b708348658d9..31128c4125506e1f27e8a2da7f6fcc2f9567e6f2 100644 (file)
@@ -152,7 +152,7 @@ class App(dict):
         self.builds = []
         self.comments = {}
         self.added = None
-        self.lastupdated = None
+        self.lastUpdated = None
 
     def __getattr__(self, name):
         if name in self:
index ea536152123befec9adb29aea9c58ba1bb855bd3..ba5fd706f15d7e61b4c78b32015b1339a066deb2 100644 (file)
@@ -115,7 +115,7 @@ def update_wiki(apps, sortedids, apks):
             appid,
             app.Name,
             time.strftime('%Y-%m-%d', app.added) if app.added else '',
-            time.strftime('%Y-%m-%d', app.lastupdated) if app.lastupdated else '',
+            time.strftime('%Y-%m-%d', app.lastUpdated) if app.lastUpdated else '',
             app.SourceCode,
             app.IssueTracker,
             app.WebSite,
@@ -1132,8 +1132,8 @@ def make_index(apps, sortedids, apks, repodir, archive):
         addElement('id', app.id, doc, apel)
         if app.added:
             addElement('added', time.strftime('%Y-%m-%d', app.added), doc, apel)
-        if app.lastupdated:
-            addElement('lastupdated', time.strftime('%Y-%m-%d', app.lastupdated), doc, apel)
+        if app.lastUpdated:
+            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:
@@ -1612,12 +1612,12 @@ def main():
                 if 'added' in apk:
                     if not app.added or apk['added'] < app.added:
                         app.added = apk['added']
-                    if not app.lastupdated or apk['added'] > app.lastupdated:
-                        app.lastupdated = apk['added']
+                    if not app.lastUpdated or apk['added'] > app.lastUpdated:
+                        app.lastUpdated = apk['added']
 
         if not app.added:
             logging.debug("Don't know when " + appid + " was added")
-        if not app.lastupdated:
+        if not app.lastUpdated:
             logging.debug("Don't know when " + appid + " was last updated")
 
         if bestver == UNSET_VERSION_CODE:
index 2be4c114deb848e5c96caa3d137bba3bfcd49ac1..7f6d1589855d2013312dc6c5eb43e0f04aeaf5d9 100644 (file)
@@ -1003,5 +1003,5 @@ comments:
   build:42:
   - '#RootCommands srclib needs changing on fdroidserver'
 id: org.adaway
-lastupdated: null
+lastUpdated: null
 metadatapath: metadata/org.adaway.json
index b8b4e692ee6ad5a618a106875ea9be69f24ea156..0fdd3372edbf600e249d464b99f9597e9640526e 100644 (file)
@@ -335,5 +335,5 @@ builds:
   versionName: 0.6.0
 comments: {}
 id: org.smssecure.smssecure
-lastupdated: null
+lastUpdated: null
 metadatapath: metadata/org.smssecure.smssecure.txt
index 4e0b5c9ea5ed08d2a7d220823e2ec860a5a01b95..d905830c101e49d9af749692cffb7f2513e5ed7f 100644 (file)
@@ -2243,5 +2243,5 @@ builds:
   versionName: 1.2.6
 comments: {}
 id: org.videolan.vlc
-lastupdated: null
+lastUpdated: null
 metadatapath: metadata/org.videolan.vlc.yml