Ejemplo n.º 1
0
def refine_battle_log():
    refined_logs = set()
    count = 0
    logs = DB.find('battle_log', {}, {'_id': 0})
    for l in logs:
        refined_logs.add(json.dumps(l))
        count += 1
        print(count, end=", ")
    print("Dumping to db")
    for battle in refined_logs:
        DB.insert('refined_battle_log', json.loads(battle))
        count -= 1
        print(count, end=', ')
Ejemplo n.º 2
0
def get_cards_count():
    card_count = {}
    for c in DB.find('card_count', {}):
        card_count[c['_id']] = c['value']
    return card_count