Esempio n. 1
0
File: ice.py Progetto: rrfenton/Ice
def main():
    log_both("=========================Starting Ice")
    # Find all of the ROMs that are currently in the designated folders
    roms = console.find_all_roms()
    # Find the Steam Account that the user would like to add ROMs for
    user_ids = steam_user_manager.user_ids_on_this_machine()
    grid_manager = IceGridImageManager()
    for user_id in user_ids:
        log_both("---------------Running for user %s" % str(user_id))
        # Load their shortcuts into a SteamShortcutManager object
        shortcuts_path = steam_user_manager.shortcuts_file_for_user_id(user_id)
        try:
            shortcuts_manager = SteamShortcutManager(shortcuts_path)
        except IOError:
            log_both(
                'No previous shortcuts file found for this user. Skipping them.'
            )
            continue
        rom_manager = IceROMManager(shortcuts_manager)
        # Add the new ROMs in each folder to our Shortcut Manager
        rom_manager.sync_roms(roms)
        # Generate a new shortcuts.vdf file with all of the new additions
        shortcuts_manager.save()
        log_both("---Downloading grid images")
        grid_manager.update_user_images(user_id, roms)
    log_both("=========================Finished")
Esempio n. 2
0
 def _download_(self):
     emulators_dir = filesystem_helper.downloaded_emulators_directory()
     zips_dir = filesystem_helper.downloaded_zips_directory()
     # Make sure the directorys exists
     filesystem_helper.create_directory_if_needed(emulators_dir)
     filesystem_helper.create_directory_if_needed(zips_dir)
     url = self._download_location_
     zip_path = os.path.join(filesystem_helper.downloaded_zips_directory(),os.path.basename(url))
     # If we have downloaded (and therefore extracted) the zip file before,
     # there is no reason to do it again
     if os.path.exists(zip_path):
         log_file("Found zip file %s" % os.path.basename(url))
     else:
         log_both("Downloading %s" % url)
         (downloaded_path,headers) = urllib.urlretrieve(url)
         log_both("Finished downloading %s" % url)
         shutil.copyfile(downloaded_path,zip_path)
         self._unzip_(downloaded_path,emulators_dir)
     self.location = os.path.join(emulators_dir,self._relative_exe_path_)
     self.directory = os.path.join(emulators_dir,self._directory_name_)
Esempio n. 3
0
 def _download_(self):
     emulators_dir = filesystem_helper.downloaded_emulators_directory()
     zips_dir = filesystem_helper.downloaded_zips_directory()
     # Make sure the directorys exists
     filesystem_helper.create_directory_if_needed(emulators_dir)
     filesystem_helper.create_directory_if_needed(zips_dir)
     url = self._download_location_
     zip_path = os.path.join(filesystem_helper.downloaded_zips_directory(),
                             os.path.basename(url))
     # If we have downloaded (and therefore extracted) the zip file before,
     # there is no reason to do it again
     if os.path.exists(zip_path):
         log_file("Found zip file %s" % os.path.basename(url))
     else:
         log_both("Downloading %s" % url)
         (downloaded_path, headers) = urllib.urlretrieve(url)
         log_both("Finished downloading %s" % url)
         shutil.copyfile(downloaded_path, zip_path)
         self._unzip_(downloaded_path, emulators_dir)
     self.location = os.path.join(emulators_dir, self._relative_exe_path_)
     self.directory = os.path.join(emulators_dir, self._directory_name_)
Esempio n. 4
0
File: ice.py Progetto: castrojo/Ice
def main():
    log_both("=========================Starting Ice")
    # Find all of the ROMs that are currently in the designated folders
    roms = console.find_all_roms()
    # Find the Steam Account that the user would like to add ROMs for
    user_ids = steam_user_manager.user_ids_on_this_machine()
    grid_manager = IceGridImageManager()
    for user_id in user_ids:
        log_both("---------------Running for user %s" % str(user_id))
        # Load their shortcuts into a SteamShortcutManager object
        shortcuts_path = steam_user_manager.shortcuts_file_for_user_id(user_id)
        shortcuts_manager = SteamShortcutManager(shortcuts_path)
        rom_manager = IceROMManager(shortcuts_manager)
        # Add the new ROMs in each folder to our Shortcut Manager
        rom_manager.sync_roms(roms)
        # Generate a new shortcuts.vdf file with all of the new additions
        shortcuts_manager.save()
        if IceGridImageManager.should_download_images():
            log_both("---Downloading grid images")
            grid_manager.update_user_images(user_id,roms)
        else:
            log_both("Skipping 'Download Image' step")
    log_both("=========================Finished")
Esempio n. 5
0
File: ice.py Progetto: rrfenton/Ice
        rom_manager = IceROMManager(shortcuts_manager)
        # Add the new ROMs in each folder to our Shortcut Manager
        rom_manager.sync_roms(roms)
        # Generate a new shortcuts.vdf file with all of the new additions
        shortcuts_manager.save()
        log_both("---Downloading grid images")
        grid_manager.update_user_images(user_id, roms)
    log_both("=========================Finished")


if __name__ == "__main__":
    try:
        main()
    except ConfigError as error:
        log_user("=========================Stopping\n")
        log_file("!!!Error was Users' fault. Don't worry about it")
        log_both("There was a problem with '%s' in config.txt" %
                 error.referenced_config)
        log_both(error.fix_instructions)
        log_file("!!!")
    except StandardError as error:
        log_both("####################################")
        log_both("An Error has occurred:")
        log_both(error)
        log_exception()
        log_both("####################################")
    # Keeps the console from closing (until the user hits enter) so they can
    # read any console output
    print ""
    print "Close the window, or hit enter to exit..."
    raw_input()
Esempio n. 6
0
File: ice.py Progetto: waytai/Ice
        rom_manager = IceROMManager(shortcuts_manager)
        # Add the new ROMs in each folder to our Shortcut Manager
        rom_manager.sync_roms(roms)
        # Generate a new shortcuts.vdf file with all of the new additions
        shortcuts_manager.save()
        if IceGridImageManager.should_download_images():
            log_both("---Downloading grid images")
            grid_manager.update_user_images(user_id,roms)
        else:
            log_both("Skipping 'Download Image' step")
    log_both("=========================Finished")
        
if __name__ == "__main__":
    try:
        main()
    except ConfigError as error:
        log_user("=========================Stopping\n")
        log_config_error(error)
        log_exception()
        log_file("!!!")
    except StandardError as error:
        log_both("####################################")
        log_both("An Error has occurred:")
        log_both(error)
        log_exception()
        log_both("####################################")
    # Keeps the console from closing (until the user hits enter) so they can
    # read any console output
    print ""
    print "Close the window, or hit enter to exit..."
    raw_input()
Esempio n. 7
0
File: ice.py Progetto: PiotrWpl/Ice
def main():
    if steam_is_running():
        log_both("Ice cannot be run while Steam is open. Please close Steam and try again")
        return
    log_both("=========================Starting Ice")
    fs.create_directory_if_needed(fs.roms_directory(), log="Creating ROMs directory at %s" % fs.roms_directory())
    # Find all of the ROMs that are currently in the designated folders
    roms = console.find_all_roms()
    # Find the Steam Account that the user would like to add ROMs for
    user_ids = steam_user_manager.user_ids_on_this_machine()
    grid_manager = IceGridImageManager()
    for user_id in user_ids:
        log_both("---------------Running for user %s" % str(user_id))
        # Load their shortcuts into a SteamShortcutManager object
        shortcuts_path = steam_user_manager.shortcuts_file_for_user_id(user_id)
        shortcuts_manager = SteamShortcutManager(shortcuts_path)
        rom_manager = IceROMManager(shortcuts_manager)
        # Add the new ROMs in each folder to our Shortcut Manager
        rom_manager.sync_roms(roms)
        # Generate a new shortcuts.vdf file with all of the new additions
        shortcuts_manager.save()
        if IceGridImageManager.should_download_images():
            log_both("---Downloading grid images")
            grid_manager.update_user_images(user_id,roms)
        else:
            log_both("Skipping 'Download Image' step")
    log_both("=========================Finished")
Esempio n. 8
0
File: ice.py Progetto: ch13696/Ice
        # Add the new ROMs in each folder to our Shortcut Manager
        rom_manager.sync_roms(roms)
        # Generate a new shortcuts.vdf file with all of the new additions
        shortcuts_manager.save()
        if IceGridImageManager.should_download_images():
            log_both("---Downloading grid images")
            grid_manager.update_user_images(user_id,roms)
        else:
            log_both("Skipping 'Download Image' step")
    log_both("=========================Finished")
        
if __name__ == "__main__":
    try:
        main()
    except ConfigError as error:
        log_user("=========================Stopping\n")
        log_file("!!!Error was Users' fault. Don't worry about it")
        log_both("There was a problem with '[%s] %s' in config.txt" % (error.section, error.key))
        log_both(error.fix_instructions)
        log_file("!!!")
    except StandardError as error:
        log_both("####################################")
        log_both("An Error has occurred:")
        log_both(error)
        log_exception()
        log_both("####################################")
    # Keeps the console from closing (until the user hits enter) so they can
    # read any console output
    print ""
    print "Close the window, or hit enter to exit..."
    raw_input()