Ejemplo n.º 1
0
def steam_is_running():
  check_function = pf.platform_specific(windows=windows_steam_is_running, osx=osx_steam_is_running, linux=linux_steam_is_running)
  try:
    return check_function()
  except:
    ice_logger.log_warning('Could not determine if Steam is running. Make sure Steam is closed before running Ice.')
    return False
Ejemplo n.º 2
0
def steam_is_running():
    check_function = pf.platform_specific(windows=windows_steam_is_running,
                                          osx=osx_steam_is_running,
                                          linux=linux_steam_is_running)
    try:
        return check_function()
    except:
        ice_logger.log_warning(
            'Could not determine if Steam is running. Make sure Steam is closed before running Ice.'
        )
        return False
Ejemplo n.º 3
0
 def find_roms(self):
     """
     Reads a list of all the ROMs from the appropriate directory for the
     console
     """
     roms = []
     for filename in os.listdir(self.roms_directory()):
         file_path = os.path.join(self.roms_directory(),filename)
         if not os.path.isdir(file_path):
             # On Linux/OSX, we want to make sure hidden files don't get
             # accidently added as well
             if not pf.is_windows() and filename.startswith('.'):
                 continue
             if self.emulator is not None and not self.is_valid_rom(file_path):
                 ice_logger.log_warning("Ignoring Non-ROM file: %s" % file_path)
                 continue
             roms.append(ROM(file_path,self))
     return roms
Ejemplo n.º 4
0
 def find_roms(self):
     """
     Reads a list of all the ROMs from the appropriate directory for the
     console
     """
     roms = []
     if not os.path.exists(self.roms_directory()):
         ice_logger.log("Creating %s directory at %s" % (self.shortname,self.roms_directory()))
         os.makedirs(self.roms_directory())
     for filename in os.listdir(self.roms_directory()):
         file_path = os.path.join(self.roms_directory(),filename)
         if not os.path.isdir(file_path):
             # On Linux/OSX, we want to make sure hidden files don't get
             # accidently added as well
             if not pf.is_windows() and filename.startswith('.'):
                 continue
             if self.emulator is not None and not self.is_valid_rom(file_path):
                 ice_logger.log_warning("Ignoring Non-ROM file: %s" % file_path)
                 continue
             roms.append(ROM(file_path,self))
     return roms
Ejemplo n.º 5
0
 def update_user_images(self,user_id,roms):
     """
     Sets a suitable grid image for every rom in 'roms' for the user defined
     by 'user_id'
     """
     grid = steam_grid.SteamGrid(steam_user_manager.userdata_directory_for_user_id(user_id))
     for rom in roms:
         shortcut = rom.to_shortcut()
         if not grid.existing_image_for_filename(grid.filename_for_shortcut(shortcut.appname,shortcut.exe)):
             image = self.find_image_for_rom(rom)
             # Game not found
             if image is None:
                 ice_logger.log_warning("No game found for %s on %s" % (rom.name(),rom.console.fullname))
                 ice_logger.log("The image provider has no game called %s for %s. Try going to %s and submittng the game yourself" % (rom.name(),rom.console.fullname, self.host_for_image_source()))
             # Game found, but there is no picture
             elif image == "":
                 ice_logger.log_warning("No image found for %s. The URL checked was '%s'" % (rom.name(),self.url_for_rom(rom)))
                 ice_logger.log("We couldn't find an image for %s. If you find one you like, upload it to %s, and next time Ice runs it will use it" % (rom.name(),self.host_for_image_source()))
             # Game found, AND there is a picture there
             else:
                 ice_logger.log("Setting custom image for %s" % rom.name())
                 ice_logger.log('Found grid-image for "' + rom.name() +'"')
                 image_path = self.download_image(image)
                 grid.set_image_for_shortcut(image_path,shortcut.appname,shortcut.exe)