def validate_environment(self, app_settings, users): """ Validate that the current environment meets all of Ice's requirements. """ with EnvironmentChecker(self.filesystem) as env_checker: if not self.skip_steam_check: # If Steam is running then any changes we make will be overwritten env_checker.require_program_not_running("Steam") else: logger.warning(STEAM_CHECK_SKIPPED_WARNING) # This is used to store history information and such env_checker.require_directory_exists(paths.application_data_directory()) for console in app_settings.consoles: # Consoles assume they have a ROMs directory env_checker.require_directory_exists( consoles.console_roms_directory(app_settings.config, console) ) for user in users: # I'm not sure if there are situations where this won't exist, but I # assume that it does everywhere and better safe than sorry env_checker.require_directory_exists(user.steam.userdata_directory) # If the user hasn't added any grid images on their own then this # directory wont exist, so we require it explicitly here env_checker.require_directory_exists( steam_paths.custom_images_directory(user) ) # And it needs to be writable if we are going to save images there env_checker.require_writable_path( steam_paths.custom_images_directory(user) )
def validate_environment(self, skip_steam_check): """ Validate that the current environment meets all of Ice's requirements. """ with EnvironmentChecker(self.filesystem) as env_checker: if not skip_steam_check: # If Steam is running then any changes we make will be overwritten env_checker.require_program_not_running("Steam") else: logger.warning(STEAM_CHECK_SKIPPED_WARNING) # I'm not sure if there are situations where this won't exist, but I # assume that it does everywhere and better safe than sorry env_checker.require_directory_exists(self.steam.userdata_directory) # This is used to store history information and such env_checker.require_directory_exists(paths.application_data_directory()) for console in self.app_settings.consoles: # Consoles assume they have a ROMs directory env_checker.require_directory_exists(consoles.console_roms_directory(self.app_settings.config, console)) for user in self.users: # If the user hasn't added any grid images on their own then this # directory wont exist, so we require it explicitly here env_checker.require_directory_exists(steam_paths.custom_images_directory(user)) # And it needs to be writable if we are going to save images there env_checker.require_writable_path(steam_paths.custom_images_directory(user))
def should_use_user_override(self, override): if override is None: return False if override == "": return False if not self.filesystem.path_exists(override): logger.warning("config.txt specifies a Steam userdata directory that doesn't exist. Ignoring.") return False return False
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 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)