1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-30 15:04:18 +00:00
royalnet/db.py

21 lines
363 B
Python
Raw Normal View History

import json
2016-10-03 14:05:13 +00:00
import filemanager
2016-10-03 14:05:13 +00:00
db = json.loads(filemanager.readfile("db.json"))
2016-10-03 13:49:30 +00:00
def findbyname(name: str):
for player in db:
if player == name:
return db[player]
else:
return None
2016-10-03 13:49:30 +00:00
def findbykey(key, value):
for player in db:
if player[key] == value:
return db[player]
else:
return None