mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-10-09 02:41:06 +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
|
@ -49,3 +49,8 @@ wiki_path = "/wiki/"
|
||||||
wiki_user = "login"
|
wiki_user = "login"
|
||||||
wiki_password = "1234"
|
wiki_password = "1234"
|
||||||
|
|
||||||
|
#Only set this to true when running a repository where you want to generate
|
||||||
|
#stats, and only then on the master build servers, not a development
|
||||||
|
#machine.
|
||||||
|
update_stats = False
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,14 @@ import common
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
# Read configuration...
|
# Read configuration...
|
||||||
|
global update_stats
|
||||||
|
update_stats = False
|
||||||
execfile('config.py', globals())
|
execfile('config.py', globals())
|
||||||
|
|
||||||
|
if not update_stats:
|
||||||
|
print "Stats are disabled - check your configuration"
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# Parse command line...
|
# Parse command line...
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
||||||
|
|
|
@ -170,6 +170,8 @@ def update_wiki(apps, apks, verbose=False):
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
# Read configuration...
|
# Read configuration...
|
||||||
|
global update_stats
|
||||||
|
update_stats = False
|
||||||
execfile('config.py', globals())
|
execfile('config.py', globals())
|
||||||
|
|
||||||
# Parse command line...
|
# Parse command line...
|
||||||
|
@ -650,24 +652,26 @@ def main():
|
||||||
f.write(catdata)
|
f.write(catdata)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
# Update known apks info...
|
if update_stats:
|
||||||
knownapks.writeifchanged()
|
|
||||||
|
|
||||||
# Generate latest apps data for widget
|
# Update known apks info...
|
||||||
if os.path.exists(os.path.join('stats', 'latestapps.txt')):
|
knownapks.writeifchanged()
|
||||||
data = ''
|
|
||||||
for line in file(os.path.join('stats', 'latestapps.txt')):
|
# Generate latest apps data for widget
|
||||||
appid = line.rstrip()
|
if os.path.exists(os.path.join('stats', 'latestapps.txt')):
|
||||||
data += appid + "\t"
|
data = ''
|
||||||
for app in apps:
|
for line in file(os.path.join('stats', 'latestapps.txt')):
|
||||||
if app['id'] == appid:
|
appid = line.rstrip()
|
||||||
data += app['Name'] + "\t"
|
data += appid + "\t"
|
||||||
data += app['icon'] + "\t"
|
for app in apps:
|
||||||
data += app['License'] + "\n"
|
if app['id'] == appid:
|
||||||
break
|
data += app['Name'] + "\t"
|
||||||
f = open('repo/latestapps.dat', 'w')
|
data += app['icon'] + "\t"
|
||||||
f.write(data)
|
data += app['License'] + "\n"
|
||||||
f.close()
|
break
|
||||||
|
f = open('repo/latestapps.dat', 'w')
|
||||||
|
f.write(data)
|
||||||
|
f.close()
|
||||||
|
|
||||||
# Update the wiki...
|
# Update the wiki...
|
||||||
if options.wiki:
|
if options.wiki:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue