1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

remove level if not working

This commit is contained in:
Kay0u 2019-10-16 20:14:28 +09:00
parent 3b9f9bdcc7
commit fa66e7f629
No known key found for this signature in database
GPG key ID: 7FF262C033518333

View file

@ -30,10 +30,10 @@ if __name__ == '__main__':
print "Error: app level must be between 0 and 10, it's '%s'" % level
sys.exit(1)
if app_list[app_id]["state"] == "notworking":
print "Warning: app '%s' is currently marked as not working, the level is forced to 0" % app_id
level = 0
app_list[app_id]["level"] = int(level)
if app_list[app_id]["state"] == "working":
app_list[app_id]["level"] = int(level)
else:
print "Warning: app '%s' is currently not marked as working, the level is removed" % app_id
del app_list[app_id]["level"]
open(app_list_name, "w").write("\n".join(json.dumps(app_list, indent=4, sort_keys=True).split(" \n")) + "\n")