mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
28d57f492b
commit
5fbc000eea
23
roles.py
23
roles.py
|
@ -46,15 +46,20 @@ def clearEditorStatus(baseDir: str) -> None:
|
||||||
for f in os.scandir(directory):
|
for f in os.scandir(directory):
|
||||||
f = f.name
|
f = f.name
|
||||||
filename = os.fsdecode(f)
|
filename = os.fsdecode(f)
|
||||||
if filename.endswith(".json") and '@' in filename:
|
if '@' not in filename:
|
||||||
filename = os.path.join(baseDir + '/accounts/', filename)
|
continue
|
||||||
if '"editor"' in open(filename).read():
|
if not filename.endswith(".json"):
|
||||||
actorJson = loadJson(filename)
|
continue
|
||||||
if actorJson:
|
filename = os.path.join(baseDir + '/accounts/', filename)
|
||||||
if actorJson['roles'].get('instance'):
|
if '"editor"' not in open(filename).read():
|
||||||
if 'editor' in actorJson['roles']['instance']:
|
continue
|
||||||
actorJson['roles']['instance'].remove('editor')
|
actorJson = loadJson(filename)
|
||||||
saveJson(actorJson, filename)
|
if not actorJson:
|
||||||
|
continue
|
||||||
|
if actorJson['roles'].get('instance'):
|
||||||
|
if 'editor' in actorJson['roles']['instance']:
|
||||||
|
actorJson['roles']['instance'].remove('editor')
|
||||||
|
saveJson(actorJson, filename)
|
||||||
|
|
||||||
|
|
||||||
def addModerator(baseDir: str, nickname: str, domain: str) -> None:
|
def addModerator(baseDir: str, nickname: str, domain: str) -> None:
|
||||||
|
|
Loading…
Reference in New Issue