def app_main():
    FSGSDirectories.initialize()
    Settings.instance().verbose = False
    Settings.instance().load()
    print("base_dir", FSGSDirectories.get_base_dir())
    print("cache_dir", FSGSDirectories.get_cache_dir())
    print("cdroms_dir", FSGSDirectories.get_cdroms_dir())
    print("configurations_dir", FSGSDirectories.get_configurations_dir())
    print("controllers_dir", FSGSDirectories.get_controllers_dir())
    print("covers_dir", FSGSDirectories.get_covers_dir())
    print("data_dir", FSGSDirectories.get_data_dir())
    print("downloads_dir", FSGSDirectories.downloads_dir())
    print("floppies_dir", FSGSDirectories.get_floppies_dir())
    print("hard_drives_dir", FSGSDirectories.get_hard_drives_dir())
    # print("images_dir", FSGSDirectories.get_images_dir())
    print("kickstarts_dir", FSGSDirectories.get_kickstarts_dir())
    print("launcher_dir", FSGSDirectories.get_launcher_dir())
    print("logs_dir", FSGSDirectories.get_logs_dir())
    print("plugins_dir", FSGSDirectories.get_plugins_dir())
    # print("portable_dir", FSGSDirectories.portable_dir())
    print("save_states_dir", FSGSDirectories.get_save_states_dir())
    print("screenshots_dir", FSGSDirectories.get_screenshots_dir())
    print("screenshots_output_dir =", FSGSDirectories.screenshots_output_dir())
    print("themes_dir", FSGSDirectories.get_themes_dir())
    print("titles_dir", FSGSDirectories.get_titles_dir())
    def prepare(self):
        print("LaunchHandler.prepare")
        if not self.temp_dir:
            self.temp_dir = tempfile.mkdtemp(prefix="fs-uae-")
        print("temp dir", self.temp_dir)
        self.config["floppies_dir"] = self.temp_dir
        print("state dir", self.get_state_dir())
        self.config["state_dir"] = self.get_state_dir()
        self.config["save_states_dir"] = ""
        self.config["floppy_overlays_dir"] = ""
        self.config["flash_memory_dir"] = ""

        # FIXME: Document or change. Tests needs to be able to disable
        # saving changes or otherwise be able to start with a clean slate.

        # FIXME: Change handler is disabled for now
        # if self.config.get("__save_dir", "") == "0":
        #     pass
        # else:
        #     self.change_handler = GameChangeHandler(self.temp_dir)

        self.config["cdroms_dir"] = FSGSDirectories.get_cdroms_dir()
        self.config[
            "configurations_dir"
        ] = FSGSDirectories.get_configurations_dir()
        self.config["controllers_dir"] = FSGSDirectories.get_controllers_dir()
        self.config["hard_drives_dir"] = FSGSDirectories.get_hard_drives_dir()
        self.config["kickstarts_dir"] = FSGSDirectories.get_kickstarts_dir()
        self.config["save_states_dir"] = FSGSDirectories.get_save_states_dir()
        self.config["themes_dir"] = FSGSDirectories.get_themes_dir()

        # self.prepare_roms()
        if self.stop_flag:
            return
        self.prepare_floppies()
        if self.stop_flag:
            return
        self.prepare_cdroms()
        if self.stop_flag:
            return
        # self.prepare_hard_drives()
        if self.stop_flag:
            return
        # self.copy_hd_files()
        if self.stop_flag:
            return
        self.init_changes()
        if self.stop_flag:
            return
        self.prepare_theme()
        if self.stop_flag:
            return
        self.prepare_extra_settings()
 def get_controllers_dir(self):
     # FIXME: dependency loop
     return FSGSDirectories.get_controllers_dir()
Exemple #4
0
 def get_save_path(file_name):
     dest = FSGSDirectories.get_controllers_dir()
     if not os.path.exists(dest):
         os.makedirs(dest)
     dest = os.path.join(dest, file_name)
     return dest