当前位置: 首页>>代码示例>>Python>>正文


Python FSGSDirectories.get_save_states_dir方法代码示例

本文整理汇总了Python中fsgs.FSGSDirectories.FSGSDirectories.get_save_states_dir方法的典型用法代码示例。如果您正苦于以下问题:Python FSGSDirectories.get_save_states_dir方法的具体用法?Python FSGSDirectories.get_save_states_dir怎么用?Python FSGSDirectories.get_save_states_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fsgs.FSGSDirectories.FSGSDirectories的用法示例。


在下文中一共展示了FSGSDirectories.get_save_states_dir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_state_dir

# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_save_states_dir [as 别名]
    def _get_state_dir(self):
        config_name = self.config_name
        if not config_name:
            config_name = "Default"

        # use a temporary state dir, for now, to avoid problems with
        # floppy overlays etc interfering with net play
        from .netplay.netplay import Netplay
        if Netplay.current():
            # it is possible to manually specify the state dir
            config_name = LauncherConfig.get("__netplay_state_dir_name")
            if not config_name:
                # this is the default behavior, create a clean state
                # dir for the net play session
                netplay_game = LauncherConfig.get("__netplay_game")
                if netplay_game:
                    config_name = "Net Play ({0})".format(netplay_game)

        letter = self.get_letter(config_name)
        if not letter:
            config_name = "Default"
            letter = self.get_letter(config_name)
        # we use an existing state dir in a "letter" dir if it exists
        # (legacy support).
        path = os.path.join(FSGSDirectories.get_save_states_dir(), letter,
                            config_name)
        if os.path.exists(path):
            return path
        # if not, we use a direct sub-folder of save states dir
        path = os.path.join(FSGSDirectories.get_save_states_dir(),
                            config_name)
        return path
开发者ID:glaubitz,项目名称:fs-uae-debian,代码行数:34,代码来源:game_paths.py

示例2: _get_state_dir

# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_save_states_dir [as 别名]
    def _get_state_dir(self):
        config_name = self.config_name
        if not config_name:
            config_name = "Default"

        # Use a temporary state dir, for now, to avoid problems with
        # floppy overlays etc interfering with net play.
        if self.fsgc.netplay.enabled:
            # It is possible to manually specify the state dir.
            config_name = self.fsgc.config.get("__netplay_state_dir_name")
            if not config_name:
                # This is the default behavior, create a clean state
                # dir for the net play session.
                netplay_game = self.fsgc.config.get("__netplay_game")
                if netplay_game:
                    config_name = "Net Play ({0})".format(netplay_game)

        # Convert the config name to a name which can be represented on
        # the file system (really all/most filesystems).
        config_name = GameNameUtil.create_fs_name(config_name)

        letter = self.get_letter(config_name)
        if not letter:
            config_name = "Default"
            letter = self.get_letter(config_name)
        # We use an existing state dir in a "letter" dir if it already
        # exists (legacy support).
        path = os.path.join(
            FSGSDirectories.get_save_states_dir(), letter, config_name
        )
        if os.path.exists(path):
            return path
        # If not, we use a direct sub-folder of save states dir.
        path = os.path.join(FSGSDirectories.get_save_states_dir(), config_name)
        return path
开发者ID:FrodeSolheim,项目名称:fs-uae-launcher,代码行数:37,代码来源:saves.py

示例3: app_main

# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_save_states_dir [as 别名]
def app_main():
    FSGSDirectories.initialize()
    Settings.instance().load()
    print("")
    print("Directories:")
    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())
    print("* whdload_dir =", FSGSDirectories.get_whdload_dir())
    print("")
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:30,代码来源:list_dirs.py

示例4: get_state_dir

# 需要导入模块: from fsgs.FSGSDirectories import FSGSDirectories [as 别名]
# 或者: from fsgs.FSGSDirectories.FSGSDirectories import get_save_states_dir [as 别名]
    def get_state_dir(self):
        state_dir = os.path.join(
            FSGSDirectories.get_save_states_dir(),
            GameNameUtil.create_fs_name(self.get_name()))
        if not os.path.exists(state_dir):
            os.makedirs(state_dir)
        if self.fsgs.game.variant.uuid:
            uuid_file = os.path.join(state_dir, "uuid.txt")
            with io.open(uuid_file, "w", encoding="UTF-8") as f:
                f.write(self.fsgs.game.variant.uuid + "\n")
        # timestamp_file = os.path.join(state_dir, "timestamp.txt")
        # with open(timestamp_file, "wb") as f:
        #     f.write("\n")

        return state_dir
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:17,代码来源:runner.py


注:本文中的fsgs.FSGSDirectories.FSGSDirectories.get_save_states_dir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。