Beispiel #1
0
    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)
                )
Beispiel #2
0
  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))
Beispiel #3
0
 def validate_base_environment(self):
   """
   Validate that the current environment meets all of Ice's requirements.
   """
   if self.validated_base_environment:
     return
   with EnvironmentChecker(self.filesystem) as env_checker:
     # If Steam is running then any changes we make will be overwritten
     env_checker.require_program_not_running("Steam")
     # 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())
   self.validated_base_environment = True
Beispiel #4
0
 def validate_base_environment(self):
     """
 Validate that the current environment meets all of Ice's requirements.
 """
     if self.validated_base_environment:
         return
     with EnvironmentChecker(self.filesystem) as env_checker:
         # If Steam is running then any changes we make will be overwritten
         env_checker.require_program_not_running("Steam")
         # 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())
     self.validated_base_environment = True