Пример #1
0
    def _get_tmp_gameinfo(verbose):
        gameinfo_path = _outdir() + '/' + 'playstation.gameinfo.xml.in.tmp'
        if exists(gameinfo_path):
            return Gameinfo(gameinfo_path)

        gameinfo = GamesListScrapper.fetch_tmp_gameinfo(verbose)

        if not exists(_outdir()):
            makedirs(_outdir())

        gameinfo.save(gameinfo_path)

        return gameinfo
Пример #2
0
    def fetch_tmp_gameinfo(verbose):
        gameinfo = Gameinfo()

        game_lists = [
            'http://psxdatacenter.com/jlist.html',
            'http://psxdatacenter.com/plist.html',
            'http://psxdatacenter.com/ulist.html'
        ]

        for url in game_lists:
            page = _fetch_page(url)
            GamesListScrapper._parse_game_list_page(page, gameinfo, verbose)

        return gameinfo
Пример #3
0
#!/bin/env python3

from gameinfo import Gameinfo
from sys import argv

if __name__ == "__main__":
    if len(argv) > 1:
        for gameinfo_path in argv[1:]:
            gameinfo = Gameinfo(gameinfo_path)
            gameinfo.save(gameinfo_path)
Пример #4
0
            del disc_set.attrib['info']

        gameinfo.set_game_title(game, reference_title)

def merge_disc_titles(gameinfo, reference):
    for reference_disc in reference.findall('games/game/discs/disc[_title]'):
        disc_id = reference_disc.get('id')
        title = reference_disc.find('_title').text
        gameinfo.set_disc_title_for_disc_id(disc_id, title)
        disc_set = gameinfo.find('games/game/discs/disc[@id="' + disc_id + '"]/..')
        attribs = disc_set.attrib
        if 'includes' in attribs.keys():
            del attribs['includes']

if __name__ == '__main__':
    if len(argv) < 4:
        exit(1)

    source_path = argv[1]
    reference_path = argv[2]
    out_path = argv[3]

    gameinfo = Gameinfo(source_path)
    reference = Gameinfo(reference_path)

    merge_missing_games(gameinfo, reference)
    merge_game_titles(gameinfo, reference)
    merge_disc_titles(gameinfo, reference)

    gameinfo.save(out_path)
Пример #5
0
#!/bin/env python3

from gameinfo import Gameinfo
from sys import argv

if __name__ == '__main__':
    if len(argv) > 1:
        for gameinfo_path in argv[1:]:
            gameinfo = Gameinfo(gameinfo_path)
            gameinfo.save(gameinfo_path)