Esempio n. 1
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)
Esempio n. 2
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)
Esempio n. 3
0
def _path_with_override(filesystem, path_override, default_name):
    if path_override is not None:
        return path_override
    return paths.highest_precedent_data_file(filesystem, default_name)
Esempio n. 4
0
def _path_with_override(filesystem, path_override, default_name):
  if path_override is not None:
    return path_override
  return paths.highest_precedent_data_file(filesystem, default_name)