Merge pull request #833 from YunoHost/force-level-if-not-working
force level if not working
This commit is contained in:
@ -30,6 +30,10 @@ if __name__ == '__main__':
|
|||||||
print "Error: app level must be between 0 and 10, it's '%s'" % level
|
print "Error: app level must be between 0 and 10, it's '%s'" % level
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
if app_list[app_id]["state"] == "working":
|
||||||
app_list[app_id]["level"] = int(level)
|
app_list[app_id]["level"] = int(level)
|
||||||
|
elif "level" in app_list[app_id]:
|
||||||
|
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")
|
open(app_list_name, "w").write("\n".join(json.dumps(app_list, indent=4, sort_keys=True).split(" \n")) + "\n")
|
||||||
|
Reference in New Issue
Block a user