コード例 #1
0
ファイル: grid.py プロジェクト: drglove/Ice
    def __call__(self, app_settings, users, dry_run):
        roms = self.rom_finder.roms_for_consoles(app_settings.config, app_settings.consoles)

        provider = settings.image_provider(app_settings.config)
        grid_updater = steam_grid_updater.SteamGridUpdater(provider)

        for user in users:
            logger.info("::Updating grid images for U:%s" % user.user_id)
            grid_updater.update_artwork_for_rom_collection(user, roms, dry_run=dry_run)
コード例 #2
0
ファイル: engine.py プロジェクト: Christopotamus/Ice
  def run(self, tasks, app_settings, dry_run=False):
    if self.steam is None:
      logger.error("Cannot run Ice because Steam doesn't appear to be installed")
      return

    logger.info("=========== Starting Ice ===========")

    for task in tasks:
      task(app_settings, self.users, dry_run=dry_run)
コード例 #3
0
ファイル: shortcuts.py プロジェクト: KevinAnthony/Ice
  def __call__(self, users, roms, dry_run):
    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(self.app_settings.config, user)

      logger.info("::Syncing Shortcuts for U:%s" % user.user_id)
      self.shortcut_synchronizer.sync_roms_for_user(user, roms, self.app_settings.consoles, dry_run=dry_run)
コード例 #4
0
ファイル: engine.py プロジェクト: gordonshieh/Ice
    def run(self, tasks, app_settings, dry_run=False):
        if self.steam is None:
            logger.error(
                "Cannot run Ice because Steam doesn't appear to be installed")
            return

        logger.info("=========== Starting Ice ===========")

        for task in tasks:
            task(app_settings, self.users, dry_run=dry_run)
コード例 #5
0
ファイル: ice_engine.py プロジェクト: Luisangonzalez/Ice
  def _create_backup(self, user, dry_run=False):
    if dry_run:
      logger.debug("Not creating backup because its a dry run")
      return

    backup_path = self.config.shortcuts_backup_path(user)
    if backup_path is None:
      logger.info("No backups directory specified, so not backing up shortcuts.vdf before overwriting. See config.txt for more info")
      return

    shortcuts.write_shortcuts(backup_path, shortcuts.get_shortcuts(user))
コード例 #6
0
ファイル: ice_engine.py プロジェクト: Luisangonzalez/Ice
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)
コード例 #7
0
    def _create_backup(self, user, dry_run=False):
        if dry_run:
            logger.debug("Not creating backup because its a dry run")
            return

        backup_path = self.config.shortcuts_backup_path(user)
        if backup_path is None:
            logger.info(
                "No backups directory specified, so not backing up shortcuts.vdf before overwriting. See config.txt for more info"
            )
            return

        shortcuts.write_shortcuts(backup_path, shortcuts.get_shortcuts(user))
コード例 #8
0
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)
コード例 #9
0
    def __call__(self, app_settings, users, dry_run):
        roms = self.rom_finder.roms_for_consoles(
            app_settings.config,
            app_settings.consoles,
        )

        provider = settings.image_provider(app_settings.config)
        grid_updater = steam_grid_updater.SteamGridUpdater(provider)

        for user in users:
            logger.info("::Updating grid images for U:%s" % user.user_id)
            grid_updater.update_artwork_for_rom_collection(user,
                                                           roms,
                                                           dry_run=dry_run)
コード例 #10
0
ファイル: shortcuts.py プロジェクト: xmmer/Ice
  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)
コード例 #11
0
ファイル: ice_engine.py プロジェクト: Luisangonzalez/Ice
  def main(self, dry_run=False):
    if self.steam is None:
      logger.error("Cannot run Ice because Steam doesn't appear to be installed")
      return

    logger.info("=========== Starting Ice ===========")
    try:
      self.validate_base_environment()
      self.validate_configuration(self.config)
    except EnvCheckerError as e:
      logger.info("Ice cannot run because of issues with your system.\n")
      logger.info("* %s" % e.message)
      logger.info("\nPlease resolve these issues and try running Ice again")
      return
    # TODO: Create any missing directories that Ice will need
    log_configuration(self.config)
    for user_context in steam.local_user_contexts(self.steam):
      logger.info("=========== User: %s ===========" % str(user_context.user_id))
      self.run_for_user(user_context, dry_run=dry_run)
コード例 #12
0
ファイル: logging.py プロジェクト: KevinAnthony/Ice
  def __call__(self, users, roms, dry_run):
    for emulator in self.app_settings.emulators:
      logger.info("Detected Emulator: %s" % emulator.name)

    for console in self.app_settings.consoles:
      logger.info("Detected Console: %s => %s" % (console.fullname, console.emulator.name))

    if len(users) is 0:
      logger.info("No users were found in Steam's userdata, so Ice has no shortcuts to set. Has anyone logged in on this computer before?")
      return

    user_ids = map(lambda u: u.user_id, users)
    logger.info("===== Running for users: %s =====" % ", ".join(user_ids))
コード例 #13
0
    def main(self, dry_run=False):
        if self.steam is None:
            logger.error(
                "Cannot run Ice because Steam doesn't appear to be installed")
            return

        logger.info("=========== Starting Ice ===========")
        try:
            self.validate_base_environment()
            self.validate_configuration(self.config)
        except EnvCheckerError as e:
            logger.info("Ice cannot run because of issues with your system.\n")
            logger.info("* %s" % e.message)
            logger.info(
                "\nPlease resolve these issues and try running Ice again")
            return
        # TODO: Create any missing directories that Ice will need
        log_configuration(self.config)
        for user_context in steam.local_user_contexts(self.steam):
            logger.info("=========== User: %s ===========" %
                        str(user_context.user_id))
            self.run_for_user(user_context, dry_run=dry_run)
コード例 #14
0
    def __call__(self, users, roms, dry_run):
        for emulator in self.app_settings.emulators:
            logger.info("Detected Emulator: %s" % emulator.name)

        for console in self.app_settings.consoles:
            logger.info("Detected Console: %s => %s" %
                        (console.fullname, console.emulator.name))

        if len(users) is 0:
            logger.info(
                "No users were found in Steam's userdata, so Ice has no shortcuts to set. Has anyone logged in on this computer before?"
            )
            return

        user_ids = map(lambda u: u.user_id, users)
        logger.info("===== Running for users: %s =====" % ", ".join(user_ids))
コード例 #15
0
ファイル: engine.py プロジェクト: KevinAnthony/Ice
  def run(self, tasks, skip_steam_check=False, dry_run=False):
    if self.steam is None:
      logger.error("Cannot run Ice because Steam doesn't appear to be installed")
      return

    logger.info("=========== Starting Ice ===========")
    try:
      self.validate_environment(skip_steam_check)
    except EnvCheckerError as e:
      logger.info("Ice cannot run because of issues with your system.\n")
      logger.info("* %s" % e.message)
      logger.info("\nPlease resolve these issues and try running Ice again")
      return

    roms = self.rom_finder.roms_for_consoles(self.app_settings.consoles)

    for task in tasks:
      task(self.users, roms, dry_run=dry_run)
コード例 #16
0
ファイル: main.py プロジェクト: KevinAnthony/Ice
  def run(self):
    if self.steam is None:
      logger.error("Cannot run Ice because Steam doesn't appear to be installed")
      return

    logger.info("=========== Starting Ice ===========")
    try:
      self.validate_environment(self.options.skip_steam_check)
    except EnvCheckerError as e:
      logger.info("Ice cannot run because of issues with your system.\n")
      logger.info("* %s" % e.message)
      logger.info("\nPlease resolve these issues and try running Ice again")
      return

    self.__roms = self.rom_finder.roms_for_consoles(self.app_settings.consoles)
    self.__init__gui()
    self.show()
    sys.exit(self.app.exec_())
コード例 #17
0
    def run(self, tasks, skip_steam_check=False, dry_run=False):
        if self.steam is None:
            logger.error(
                "Cannot run Ice because Steam doesn't appear to be installed")
            return

        logger.info("=========== Starting Ice ===========")
        try:
            self.validate_environment(skip_steam_check)
        except EnvCheckerError as e:
            logger.info("Ice cannot run because of issues with your system.\n")
            logger.info("* %s" % e.message)
            logger.info(
                "\nPlease resolve these issues and try running Ice again")
            return

        roms = self.rom_finder.roms_for_consoles(self.app_settings.consoles)

        for task in tasks:
            task(self.users, roms, dry_run=dry_run)
コード例 #18
0
ファイル: ice_engine.py プロジェクト: Luisangonzalez/Ice
 def run_for_user(self, user, dry_run=False):
   try:
     self.validate_base_environment()
     self.validate_configuration(self.config)
     self.validate_user_environment(user)
   except EnvCheckerError as e:
     logger.info("Ice cannot run because of issues with your system.\n")
     logger.info("\t%s\n" % e.message)
     logger.info("Please resolve these issues and try running Ice again")
     return
   self._create_backup(user, dry_run=dry_run)
   # Find all of the ROMs that are currently in the designated folders
   roms = self.rom_finder.roms_for_consoles(self.config.console_manager)
   self.shortcut_synchronizer.sync_roms_for_user(user, roms, self.config, dry_run=dry_run)
   self.grid_updater.update_artwork_for_rom_collection(user, roms, dry_run=dry_run)
コード例 #19
0
 def run_for_user(self, user, dry_run=False):
     try:
         self.validate_base_environment()
         self.validate_configuration(self.config)
         self.validate_user_environment(user)
     except EnvCheckerError as e:
         logger.info("Ice cannot run because of issues with your system.\n")
         logger.info("\t%s\n" % e.message)
         logger.info(
             "Please resolve these issues and try running Ice again")
         return
     self._create_backup(user, dry_run=dry_run)
     # Find all of the ROMs that are currently in the designated folders
     roms = self.rom_finder.roms_for_consoles(self.config.console_manager)
     self.shortcut_synchronizer.sync_roms_for_user(user,
                                                   roms,
                                                   self.config,
                                                   dry_run=dry_run)
     self.grid_updater.update_artwork_for_rom_collection(user,
                                                         roms,
                                                         dry_run=dry_run)
コード例 #20
0
ファイル: ice_engine.py プロジェクト: Luisangonzalez/Ice
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)
コード例 #21
0
ファイル: grid.py プロジェクト: KevinAnthony/Ice
 def __call__(self, users, roms, dry_run):
   for user in users:
     logger.info("::Updating grid images for U:%s" % user.user_id)
     self.grid_updater.update_artwork_for_rom_collection(user, roms, dry_run=dry_run)
コード例 #22
0
ファイル: grid.py プロジェクト: KevinAnthony/Ice
 def __call__(self, users, roms, dry_run):
     for user in users:
         logger.info("::Updating grid images for U:%s" % user.user_id)
         self.grid_updater.update_artwork_for_rom_collection(
             user, roms, dry_run=dry_run)
コード例 #23
0
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)