Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
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)
Пример #4
0
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)
Пример #5
0
def loadfile(fpath, limit=INSANE_CARD_LIMIT):
    j = ojson_load(fpath)
    return loadjson(j, limit=limit)
Пример #6
0
def loadfile(fpath):
    j = ojson_load(fpath)
    return loadjson(j)