#!python3 ''' Usage: gamechest.py --gamelist=GAMELIST.YAML --gamedir=GAMEDIR ''' import logging import os from logging import debug, info, warning, critical import docopt import yaml import gamemanager def main(): logging.basicConfig(level=logging.DEBUG) logging.getLogger().handlers[0].setFormatter(logging.Formatter( "gamechest: %(levelname)s: %(funcName)s:%(lineno)s: %(message)s")) args = docopt.docopt(__doc__) debug('args: %s', args) gamelist_dir = ( os.path.dirname(args['--gamelist']) + '/.' + os.path.basename(args['--gamelist']) + '.d' ) gamelist = GameList(args['--gamelist'], args['--gamedir']) builder = gtk.Builder() builder.add_from_file('gamechest.glade') builder.connect_signals( Handler(builder, gamelist, gamelist_dir, args['--gamedir'])) window = builder.get_object('window2') window.show_all() gamelist_store = builder.get_object('gamelist_store') gamelist_store.clear() for index, game in enumerate(gamelist.yaml_data['games']): gamelist_store.append((False, game['title'], index)) info('%d games loaded', len(gamelist.yaml_data['games'])) gtk.main() def main(): import sys gamelist_path = sys.argv[1] gamedir_path = sys.argv[2] action_name = sys.argv[3] game_name = sys.argv[4] # used to determine game_id # TODO: # - parse gamelist (conf) # - parse package installed info or empty (conf) # - follow action (install, remove, update) # - use name on game name # - update status bar from polling (with a timer, or a simple sleep) # - if run, run the game. if __name__ == '__main__': main()