Пример #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 __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)
Пример #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)
Пример #5
0
  def __init__(self, app_settings):
    self.app_settings = app_settings

    managed_rom_archive = history.ManagedROMArchive(paths.archive_path())
    self.shortcut_synchronizer = SteamShortcutSynchronizer(app_settings.config, managed_rom_archive)