Example #1
0
File: ice.py Project: rrfenton/Ice
def main():
    log_both("=========================Starting Ice")
    # Find all of the ROMs that are currently in the designated folders
    roms = console.find_all_roms()
    # Find the Steam Account that the user would like to add ROMs for
    user_ids = steam_user_manager.user_ids_on_this_machine()
    grid_manager = IceGridImageManager()
    for user_id in user_ids:
        log_both("---------------Running for user %s" % str(user_id))
        # Load their shortcuts into a SteamShortcutManager object
        shortcuts_path = steam_user_manager.shortcuts_file_for_user_id(user_id)
        try:
            shortcuts_manager = SteamShortcutManager(shortcuts_path)
        except IOError:
            log_both(
                'No previous shortcuts file found for this user. Skipping them.'
            )
            continue
        rom_manager = IceROMManager(shortcuts_manager)
        # Add the new ROMs in each folder to our Shortcut Manager
        rom_manager.sync_roms(roms)
        # Generate a new shortcuts.vdf file with all of the new additions
        shortcuts_manager.save()
        log_both("---Downloading grid images")
        grid_manager.update_user_images(user_id, roms)
    log_both("=========================Finished")
Example #2
0
def main():
    if steam_is_running():
        ice_logger.log_error(
            "Ice cannot be run while Steam is open. Please close Steam and try again"
        )
        return

    ice_logger.log("Starting Ice")
    # Find all of the ROMs that are currently in the designated folders
    roms = console.find_all_roms()
    # Find the Steam Account that the user would like to add ROMs for
    user_ids = steam_user_manager.user_ids_on_this_machine()
    grid_manager = IceGridImageManager()
    for user_id in user_ids:
        ice_logger.log("Running for user %s" % str(user_id))
        # Load their shortcuts into a SteamShortcutManager object
        shortcuts_path = steam_user_manager.shortcuts_file_for_user_id(user_id)
        shortcuts_manager = SteamShortcutManager(shortcuts_path)
        rom_manager = IceROMManager(shortcuts_manager)
        # Add the new ROMs in each folder to our Shortcut Manager
        rom_manager.sync_roms(roms)
        # Backup the current shortcuts.vdf file
        shortcuts_manager.backup()
        # Generate a new shortcuts.vdf file with all of the new additions
        shortcuts_manager.save()
        grid_manager.update_user_images(user_id, roms)
    ice_logger.log('Ice finished')