예제 #1
0
    def __init__(self,
                 config_override=None,
                 consoles_override=None,
                 emulators_override=None):
        self.validated_base_environment = False
        self.validated_configuration = False
        self.logger = IceLogger()
        self.logger.debug("Initializing Ice")
        config_data_path = _path_with_override(config_override, "config.txt")
        consoles_data_path = _path_with_override(consoles_override,
                                                 "consoles.txt")
        emulators_data_path = _path_with_override(emulators_override,
                                                  "emulators.txt")
        self.config = Configuration(
            ConfigFileBackingStore(config_data_path),
            ConfigFileBackingStore(consoles_data_path),
            ConfigFileBackingStore(emulators_data_path),
        )
        self.steam = Steam()
        # TODO: Query the list of users some other way
        self.users = self.steam.local_users()

        filesystem = Filesystem()
        parser = ROMParser(self.logger)
        self.rom_finder = ROMFinder(self.config, filesystem, parser)
        archive_data_path = Configuration.path_for_data_file("archive.json")
        managed_rom_archive = ManagedROMArchive(archive_data_path)
        self.shortcut_synchronizer = SteamShortcutSynchronizer(
            managed_rom_archive, self.logger)

        provider = CombinedProvider(
            LocalProvider(self.logger),
            ConsoleGridProvider(self.logger),
        )
        self.grid_updater = SteamGridUpdater(provider, self.logger)
예제 #2
0
 def _load_roms_for_test(self, directory):
     """Takes the ROMs located in `directory/ROMs` and moves them into the
 ROMs directory specified in the provided config.txt file."""
     # TODO: This is extremely non-kosher. The fact that I have to do this
     # suggests that something is very wrong with my Configuration object.
     #
     # Knowing that object I'm tempted to agree.
     c = Configuration(
         ConfigFileBackingStore(self._test_config_path(directory,
                                                       'config')),
         None,
         None,
         None,
     )
     target_roms_directory = self.sandbox.adjusted_path(c.roms_directory())
     source_roms_directory = os.path.join(directory, 'ROMs')
     shutil.copytree(source_roms_directory, target_roms_directory)
예제 #3
0
    def __init__(self, steam, filesystem, options):
        """Valid options for creating an IceEngine are as follows:

    * config    - The path to the config file to use. Searches the default paths
                  for 'config.txt' otherwise
    * consoles  - The path to the consoles file to use. Searches the default
                  paths for 'consoles.txt' if none is provided
    * emulators - The path to the emulators file to use. Searches the default
                  paths for 'emulators.txt' if none is provided
    """
        self.validated_base_environment = False
        self.validated_configuration = False
        self.filesystem = filesystem
        logger.debug("Initializing Ice")
        config_data_path = _path_with_override(filesystem, options.config,
                                               "config.txt")
        consoles_data_path = _path_with_override(filesystem, options.consoles,
                                                 "consoles.txt")
        emulators_data_path = _path_with_override(filesystem,
                                                  options.emulators,
                                                  "emulators.txt")
        self.config = Configuration(
            ConfigFileBackingStore(config_data_path),
            ConfigFileBackingStore(consoles_data_path),
            ConfigFileBackingStore(emulators_data_path),
            filesystem,
        )
        self.steam = steam

        parser = ROMParser()
        self.rom_finder = ROMFinder(self.config, filesystem, parser)
        archive_data_path = paths.highest_precedent_data_file(
            filesystem, "archive.json")
        managed_rom_archive = ManagedROMArchive(archive_data_path)
        self.shortcut_synchronizer = SteamShortcutSynchronizer(
            managed_rom_archive)

        provider = CombinedProvider(
            LocalProvider(),
            ConsoleGridProvider(),
        )
        self.grid_updater = SteamGridUpdater(provider)
예제 #4
0
    def __init__(self, options):
        """Valid options for creating an IceEngine are as follows:

    * config    - The path to the config file to use. Searches the default paths
                  for 'config.txt' otherwise
    * consoles  - The path to the consoles file to use. Searches the default
                  paths for 'consoles.txt' if none is provided
    * emulators - The path to the emulators file to use. Searches the default
                  paths for 'emulators.txt' if none is provided
    * verbose   - Turn on debug logging.
    """
        self.validated_base_environment = False
        self.validated_configuration = False
        self.logger = IceLogger(verbose=options.verbose)
        self.logger.debug("Initializing Ice")
        config_data_path = _path_with_override(options.config, "config.txt")
        consoles_data_path = _path_with_override(options.consoles,
                                                 "consoles.txt")
        emulators_data_path = _path_with_override(options.emulators,
                                                  "emulators.txt")
        self.config = Configuration(
            ConfigFileBackingStore(config_data_path),
            ConfigFileBackingStore(consoles_data_path),
            ConfigFileBackingStore(emulators_data_path),
        )
        self.steam = Steam()
        # TODO: Query the list of users some other way
        self.users = self.steam.local_users()

        filesystem = Filesystem()
        parser = ROMParser(self.logger)
        self.rom_finder = ROMFinder(self.config, filesystem, parser)
        archive_data_path = Configuration.path_for_data_file("archive.json")
        managed_rom_archive = ManagedROMArchive(archive_data_path)
        self.shortcut_synchronizer = SteamShortcutSynchronizer(
            managed_rom_archive, self.logger)

        provider = CombinedProvider(
            LocalProvider(self.logger),
            ConsoleGridProvider(self.logger),
        )
        self.grid_updater = SteamGridUpdater(provider, self.logger)