2024-04-25 21:32:57 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2024-03-14 10:15:53 +01:00
|
|
|
from os.path import expanduser
|
|
|
|
import json
|
|
|
|
|
|
|
|
|
|
|
|
def _users():
|
|
|
|
result = {}
|
|
|
|
try:
|
|
|
|
with open(expanduser("~/dev/mm-archiver/data/users.json"), encoding="utf-8") as fh:
|
|
|
|
for line in fh:
|
|
|
|
user = json.loads(line)
|
|
|
|
result[user["id"]] = user
|
|
|
|
return result
|
|
|
|
except FileNotFoundError:
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
USERS = _users()
|