chiark / gitweb /
use var naming scheme in KnownApks (apk --> apkName)
authorHans-Christoph Steiner <hans@eds.org>
Thu, 1 Jun 2017 08:27:35 +0000 (10:27 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 1 Jun 2017 14:01:05 +0000 (16:01 +0200)
Everywhere else, the file name of the APK is called apkName.

fdroidserver/common.py

index 75eac97cafb777403891f45f77b27bd18874223c..acca01dd104984c761377e54cca96a99b32172e9 100644 (file)
@@ -1582,6 +1582,11 @@ def natural_key(s):
 
 
 class KnownApks:
+    """permanent store of existing APKs with the date they were added
+
+    This is currently the only way to permanently store the "updated"
+    date of APKs.
+    """
 
     def __init__(self):
         self.path = os.path.join('stats', 'known_apks.txt')
@@ -1615,17 +1620,17 @@ class KnownApks:
             for line in sorted(lst, key=natural_key):
                 f.write(line + '\n')
 
-    def recordapk(self, apk, app, default_date=None):
+    def recordapk(self, apkName, app, default_date=None):
         '''
         Record an apk (if it's new, otherwise does nothing)
         Returns the date it was added as a datetime instance
         '''
-        if apk not in self.apks:
+        if apkName not in self.apks:
             if default_date is None:
                 default_date = datetime.utcnow()
-            self.apks[apk] = (app, default_date)
+            self.apks[apkName] = (app, default_date)
             self.changed = True
-        _, added = self.apks[apk]
+        _, added = self.apks[apkName]
         return added
 
     # Look up information - given the 'apkname', returns (app id, date added/None).