def __call__(self, app_settings, users, dry_run): roms = self.rom_finder.roms_for_consoles(app_settings.config, app_settings.consoles) provider = settings.image_provider(app_settings.config) grid_updater = steam_grid_updater.SteamGridUpdater(provider) for user in users: logger.info("::Updating grid images for U:%s" % user.user_id) grid_updater.update_artwork_for_rom_collection(user, roms, dry_run=dry_run)
def run(self, tasks, app_settings, dry_run=False): if self.steam is None: logger.error("Cannot run Ice because Steam doesn't appear to be installed") return logger.info("=========== Starting Ice ===========") for task in tasks: task(app_settings, self.users, dry_run=dry_run)
def __call__(self, users, roms, dry_run): for user in users: if dry_run: logger.debug("Not creating backup because its a dry run") else: logger.info("::Backing up shortcuts for U:%s" % user.user_id) backups.create_backup_of_shortcuts(self.app_settings.config, user) logger.info("::Syncing Shortcuts for U:%s" % user.user_id) self.shortcut_synchronizer.sync_roms_for_user(user, roms, self.app_settings.consoles, dry_run=dry_run)
def run(self, tasks, app_settings, dry_run=False): if self.steam is None: logger.error( "Cannot run Ice because Steam doesn't appear to be installed") return logger.info("=========== Starting Ice ===========") for task in tasks: task(app_settings, self.users, dry_run=dry_run)
def _create_backup(self, user, dry_run=False): if dry_run: logger.debug("Not creating backup because its a dry run") return backup_path = self.config.shortcuts_backup_path(user) if backup_path is None: logger.info("No backups directory specified, so not backing up shortcuts.vdf before overwriting. See config.txt for more info") return shortcuts.write_shortcuts(backup_path, shortcuts.get_shortcuts(user))
def log_console_state(console): """ Logs whether a console is enabled or not. """ if consoles.console_is_enabled(console): logger.info("Detected Console: %s => %s" % (console.fullname, console.emulator.name)) # TODO: Move this logic into a function on Console which gives a # stringified reason why the console is not enabled elif console.emulator is None: logger.warning("No emulator provided for console `%s`" % console.fullname) else: logger.warning("Issue detected with console `%s`" % console.fullname)
def _create_backup(self, user, dry_run=False): if dry_run: logger.debug("Not creating backup because its a dry run") return backup_path = self.config.shortcuts_backup_path(user) if backup_path is None: logger.info( "No backups directory specified, so not backing up shortcuts.vdf before overwriting. See config.txt for more info" ) return shortcuts.write_shortcuts(backup_path, shortcuts.get_shortcuts(user))
def __call__(self, app_settings, users, dry_run): roms = self.rom_finder.roms_for_consoles( app_settings.config, app_settings.consoles, ) provider = settings.image_provider(app_settings.config) grid_updater = steam_grid_updater.SteamGridUpdater(provider) for user in users: logger.info("::Updating grid images for U:%s" % user.user_id) grid_updater.update_artwork_for_rom_collection(user, roms, dry_run=dry_run)
def __call__(self, app_settings, users, dry_run): roms = self.rom_finder.roms_for_consoles( app_settings.config, app_settings.consoles, ) managed_rom_archive = history.ManagedROMArchive(paths.archive_path()) shortcut_synchronizer = SteamShortcutSynchronizer(app_settings.config, managed_rom_archive) for user in users: if dry_run: logger.debug("Not creating backup because its a dry run") else: logger.info("::Backing up shortcuts for U:%s" % user.user_id) backups.create_backup_of_shortcuts(app_settings.config, user) logger.info("::Syncing Shortcuts for U:%s" % user.user_id) shortcut_synchronizer.sync_roms_for_user(user, roms, app_settings.consoles, dry_run=dry_run)
def main(self, dry_run=False): if self.steam is None: logger.error("Cannot run Ice because Steam doesn't appear to be installed") return logger.info("=========== Starting Ice ===========") try: self.validate_base_environment() self.validate_configuration(self.config) except EnvCheckerError as e: logger.info("Ice cannot run because of issues with your system.\n") logger.info("* %s" % e.message) logger.info("\nPlease resolve these issues and try running Ice again") return # TODO: Create any missing directories that Ice will need log_configuration(self.config) for user_context in steam.local_user_contexts(self.steam): logger.info("=========== User: %s ===========" % str(user_context.user_id)) self.run_for_user(user_context, dry_run=dry_run)
def __call__(self, users, roms, dry_run): for emulator in self.app_settings.emulators: logger.info("Detected Emulator: %s" % emulator.name) for console in self.app_settings.consoles: logger.info("Detected Console: %s => %s" % (console.fullname, console.emulator.name)) if len(users) is 0: logger.info("No users were found in Steam's userdata, so Ice has no shortcuts to set. Has anyone logged in on this computer before?") return user_ids = map(lambda u: u.user_id, users) logger.info("===== Running for users: %s =====" % ", ".join(user_ids))
def main(self, dry_run=False): if self.steam is None: logger.error( "Cannot run Ice because Steam doesn't appear to be installed") return logger.info("=========== Starting Ice ===========") try: self.validate_base_environment() self.validate_configuration(self.config) except EnvCheckerError as e: logger.info("Ice cannot run because of issues with your system.\n") logger.info("* %s" % e.message) logger.info( "\nPlease resolve these issues and try running Ice again") return # TODO: Create any missing directories that Ice will need log_configuration(self.config) for user_context in steam.local_user_contexts(self.steam): logger.info("=========== User: %s ===========" % str(user_context.user_id)) self.run_for_user(user_context, dry_run=dry_run)
def __call__(self, users, roms, dry_run): for emulator in self.app_settings.emulators: logger.info("Detected Emulator: %s" % emulator.name) for console in self.app_settings.consoles: logger.info("Detected Console: %s => %s" % (console.fullname, console.emulator.name)) if len(users) is 0: logger.info( "No users were found in Steam's userdata, so Ice has no shortcuts to set. Has anyone logged in on this computer before?" ) return user_ids = map(lambda u: u.user_id, users) logger.info("===== Running for users: %s =====" % ", ".join(user_ids))
def run(self, tasks, skip_steam_check=False, dry_run=False): if self.steam is None: logger.error("Cannot run Ice because Steam doesn't appear to be installed") return logger.info("=========== Starting Ice ===========") try: self.validate_environment(skip_steam_check) except EnvCheckerError as e: logger.info("Ice cannot run because of issues with your system.\n") logger.info("* %s" % e.message) logger.info("\nPlease resolve these issues and try running Ice again") return roms = self.rom_finder.roms_for_consoles(self.app_settings.consoles) for task in tasks: task(self.users, roms, dry_run=dry_run)
def run(self): if self.steam is None: logger.error("Cannot run Ice because Steam doesn't appear to be installed") return logger.info("=========== Starting Ice ===========") try: self.validate_environment(self.options.skip_steam_check) except EnvCheckerError as e: logger.info("Ice cannot run because of issues with your system.\n") logger.info("* %s" % e.message) logger.info("\nPlease resolve these issues and try running Ice again") return self.__roms = self.rom_finder.roms_for_consoles(self.app_settings.consoles) self.__init__gui() self.show() sys.exit(self.app.exec_())
def run(self, tasks, skip_steam_check=False, dry_run=False): if self.steam is None: logger.error( "Cannot run Ice because Steam doesn't appear to be installed") return logger.info("=========== Starting Ice ===========") try: self.validate_environment(skip_steam_check) except EnvCheckerError as e: logger.info("Ice cannot run because of issues with your system.\n") logger.info("* %s" % e.message) logger.info( "\nPlease resolve these issues and try running Ice again") return roms = self.rom_finder.roms_for_consoles(self.app_settings.consoles) for task in tasks: task(self.users, roms, dry_run=dry_run)
def run_for_user(self, user, dry_run=False): try: self.validate_base_environment() self.validate_configuration(self.config) self.validate_user_environment(user) except EnvCheckerError as e: logger.info("Ice cannot run because of issues with your system.\n") logger.info("\t%s\n" % e.message) logger.info("Please resolve these issues and try running Ice again") return self._create_backup(user, dry_run=dry_run) # Find all of the ROMs that are currently in the designated folders roms = self.rom_finder.roms_for_consoles(self.config.console_manager) self.shortcut_synchronizer.sync_roms_for_user(user, roms, self.config, dry_run=dry_run) self.grid_updater.update_artwork_for_rom_collection(user, roms, dry_run=dry_run)
def run_for_user(self, user, dry_run=False): try: self.validate_base_environment() self.validate_configuration(self.config) self.validate_user_environment(user) except EnvCheckerError as e: logger.info("Ice cannot run because of issues with your system.\n") logger.info("\t%s\n" % e.message) logger.info( "Please resolve these issues and try running Ice again") return self._create_backup(user, dry_run=dry_run) # Find all of the ROMs that are currently in the designated folders roms = self.rom_finder.roms_for_consoles(self.config.console_manager) self.shortcut_synchronizer.sync_roms_for_user(user, roms, self.config, dry_run=dry_run) self.grid_updater.update_artwork_for_rom_collection(user, roms, dry_run=dry_run)
def log_emulator_state(emulator): if emulators.emulator_is_enabled(emulator): logger.info("Detected Emulator: %s" % emulator.name) else: logger.warning("Issue detected with emulator `%s`" % emulator.name)
def __call__(self, users, roms, dry_run): for user in users: logger.info("::Updating grid images for U:%s" % user.user_id) self.grid_updater.update_artwork_for_rom_collection(user, roms, dry_run=dry_run)
def __call__(self, users, roms, dry_run): for user in users: logger.info("::Updating grid images for U:%s" % user.user_id) self.grid_updater.update_artwork_for_rom_collection( user, roms, dry_run=dry_run)