Ejemplo n.º 1
0
def test_game():
    print_game('gb64', '5665')

    g = search_game('gb64', '5665')
    eq_(g.source, 'gb64')
    eq_(g.id, 5665)
    eq_(g.name, "Pharaoh's Curse")
    eq_(g.platform, 'c64')
Ejemplo n.º 2
0
def install_game(source, id, downloadonly=False,
                 unpackonly=False, removezip=False, nocache=False):
    '''download and unpack game found in database
    :param source: ['gb64',..]
    :param id:     ['1',..]
    '''
    game = info.search_game(source, id)
    if not game:
        game = update_game(source, id)
    install(game, downloadonly, unpackonly, removezip, nocache)
    return game
Ejemplo n.º 3
0
def run_game(source, id, runner='auto', auto_install=False):
    ''' start game using selected emulator
    :param source: ['gb64',..]
    :param id:     ['1',..]
    :param runner: emulator ['auto','dosbox','scummvm',..]
    '''
    game = info.search_game(source, id)
    if not game or not game.dir:
        if auto_install:
            game = install_game(source, id)
        else:
            print message.format(source=source, id=str(id))
            return
    run(game, runner)
Ejemplo n.º 4
0
def run_game(source, id, runner='auto', auto_install=False):
    ''' start game using selected emulator
    :param source: ['gb64',..]
    :param id:     ['1',..]
    :param runner: emulator ['auto','dosbox','scummvm',..]
    '''
    game = info.search_game(source, id)
    if not game or not game.dir:
        if auto_install:
            game = install_game(source, id)
        else:
            print message.format(source=source, id=str(id))
            return
    run(game, runner)
Ejemplo n.º 5
0
def install_game(source,
                 id,
                 downloadonly=False,
                 unpackonly=False,
                 removezip=False,
                 nocache=False):
    '''download and unpack game found in database
    :param source: ['gb64',..]
    :param id:     ['1',..]
    '''
    game = info.search_game(source, id)
    if not game:
        game = update_game(source, id)
    install(game, downloadonly, unpackonly, removezip, nocache)
    return game