X-Git-Url: https://git.yukkurigames.com/?p=mlpccg-meta.git;a=blobdiff_plain;f=mlpccg%2FCardDb.py;h=4111683cd649ea30402a927ec2539a7f058231d6;hp=043bc92ec68d2d3cc6b0610d0f8e2e311fd68208;hb=dcc0b87f90a78345693587eab64dbb6c792a94b1;hpb=a7a7ac1456426456a5a33ebeac28693804693716 diff --git a/mlpccg/CardDb.py b/mlpccg/CardDb.py index 043bc92..4111683 100644 --- a/mlpccg/CardDb.py +++ b/mlpccg/CardDb.py @@ -2,9 +2,10 @@ import json import os import urllib import logging +import time class CardDb: - set_ids = { + set_ids = { # NOTE: if there is ever an 'f' in here, update the ponyhead link generation 'Premiere': 'pr', 'Canterlot Nights': 'cn', 'Rock \'n Rave': 'rr', @@ -14,7 +15,7 @@ class CardDb: set_names = {} # generated - def __init__(self, json_path='cards.json', extra_path='cards_extra.json'): + def __init__(self, json_path='data/cards.json', extra_path='data/cards_extra.json'): logging.debug('init card database') for name, id in CardDb.set_ids.iteritems(): @@ -68,7 +69,7 @@ class CardDb: except IOError: logging.exception('failed') - def download_cards_json(self, json_path='cards.json', url='https://dl.dropboxusercontent.com/u/32733446/cards.json'): + def download_cards_json(self, json_path='data/cards.json', url='https://dl.dropboxusercontent.com/u/32733446/cards.json'): logging.debug('downloading %s from %s', json_path, url) try: urllib.urlretrieve(url, json_path)