mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-06 11:00:13 +02:00
use var naming scheme in KnownApks (apk --> apkName)
Everywhere else, the file name of the APK is called apkName.
This commit is contained in:
parent
9471bf2731
commit
6105f8a184
@ -1582,6 +1582,11 @@ def natural_key(s):
|
|||||||
|
|
||||||
|
|
||||||
class KnownApks:
|
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):
|
def __init__(self):
|
||||||
self.path = os.path.join('stats', 'known_apks.txt')
|
self.path = os.path.join('stats', 'known_apks.txt')
|
||||||
@ -1615,17 +1620,17 @@ class KnownApks:
|
|||||||
for line in sorted(lst, key=natural_key):
|
for line in sorted(lst, key=natural_key):
|
||||||
f.write(line + '\n')
|
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)
|
Record an apk (if it's new, otherwise does nothing)
|
||||||
Returns the date it was added as a datetime instance
|
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:
|
if default_date is None:
|
||||||
default_date = datetime.utcnow()
|
default_date = datetime.utcnow()
|
||||||
self.apks[apk] = (app, default_date)
|
self.apks[apkName] = (app, default_date)
|
||||||
self.changed = True
|
self.changed = True
|
||||||
_, added = self.apks[apk]
|
_, added = self.apks[apkName]
|
||||||
return added
|
return added
|
||||||
|
|
||||||
# Look up information - given the 'apkname', returns (app id, date added/None).
|
# Look up information - given the 'apkname', returns (app id, date added/None).
|
||||||
|
Loading…
Reference in New Issue
Block a user