mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-10-08 18:31:07 +03:00
Stats-related things must be explicitly enabled (issue #51)
This commit is contained in:
parent
609611d79a
commit
27a07d7063
3 changed files with 32 additions and 17 deletions
|
@ -170,6 +170,8 @@ def update_wiki(apps, apks, verbose=False):
|
|||
def main():
|
||||
|
||||
# Read configuration...
|
||||
global update_stats
|
||||
update_stats = False
|
||||
execfile('config.py', globals())
|
||||
|
||||
# Parse command line...
|
||||
|
@ -650,24 +652,26 @@ def main():
|
|||
f.write(catdata)
|
||||
f.close()
|
||||
|
||||
# Update known apks info...
|
||||
knownapks.writeifchanged()
|
||||
if update_stats:
|
||||
|
||||
# Generate latest apps data for widget
|
||||
if os.path.exists(os.path.join('stats', 'latestapps.txt')):
|
||||
data = ''
|
||||
for line in file(os.path.join('stats', 'latestapps.txt')):
|
||||
appid = line.rstrip()
|
||||
data += appid + "\t"
|
||||
for app in apps:
|
||||
if app['id'] == appid:
|
||||
data += app['Name'] + "\t"
|
||||
data += app['icon'] + "\t"
|
||||
data += app['License'] + "\n"
|
||||
break
|
||||
f = open('repo/latestapps.dat', 'w')
|
||||
f.write(data)
|
||||
f.close()
|
||||
# Update known apks info...
|
||||
knownapks.writeifchanged()
|
||||
|
||||
# Generate latest apps data for widget
|
||||
if os.path.exists(os.path.join('stats', 'latestapps.txt')):
|
||||
data = ''
|
||||
for line in file(os.path.join('stats', 'latestapps.txt')):
|
||||
appid = line.rstrip()
|
||||
data += appid + "\t"
|
||||
for app in apps:
|
||||
if app['id'] == appid:
|
||||
data += app['Name'] + "\t"
|
||||
data += app['icon'] + "\t"
|
||||
data += app['License'] + "\n"
|
||||
break
|
||||
f = open('repo/latestapps.dat', 'w')
|
||||
f.write(data)
|
||||
f.close()
|
||||
|
||||
# Update the wiki...
|
||||
if options.wiki:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue