def loadfile(fpath, limit=INSANE_CARD_LIMIT): # import os # cwd = os.getcwd() # nwd = os.path.dirname(os.path.abspath(__file__)) # os.chdir(nwd) # try: j = ojson_load(fpath) return loadjson(j, limit=limit)
def loadfile(fpath): # import os # cwd = os.getcwd() # nwd = os.path.dirname(os.path.abspath(__file__)) # os.chdir(nwd) # try: j = ojson_load(fpath) return loadjson(j)
def load(fpath=None): """Load the JSON from given folder or file path. """ if fpath is None: import datafiles fpath = datafiles.root if os.path.isdir(fpath): fpath = os.path.join(fpath, action+'.json') j = ojson_load(fpath) return loadjson(j)
def load(fpath=None): """Load the JSON from given folder or file path. """ if fpath is None: import datafiles fpath = datafiles.root raise NotImplementedError( "Oops, didn't put bonus data into datafiles folder.") if os.path.isdir(fpath): fpath = os.path.join(fpath, action + '.json') j = ojson_load(fpath) return loadjson(j)
def loadfile(fpath, limit=INSANE_CARD_LIMIT): j = ojson_load(fpath) return loadjson(j, limit=limit)
def loadfile(fpath): j = ojson_load(fpath) return loadjson(j)