當前位置: 首頁>>代碼示例>>Python>>正文


Python PlatformHandler.create方法代碼示例

本文整理匯總了Python中fsgs.platform.PlatformHandler.create方法的典型用法代碼示例。如果您正苦於以下問題:Python PlatformHandler.create方法的具體用法?Python PlatformHandler.create怎麽用?Python PlatformHandler.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在fsgs.platform.PlatformHandler的用法示例。


在下文中一共展示了PlatformHandler.create方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: load_game_variant

# 需要導入模塊: from fsgs.platform import PlatformHandler [as 別名]
# 或者: from fsgs.platform.PlatformHandler import create [as 別名]
    def load_game_variant(self, variant_uuid):
        # game_database = fsgs.get_game_database()
        # values = game_database.get_game_values_for_uuid(variant_uuid)

        from .Database import Database
        database = Database.instance()
        try:
            database_name = database.find_game_database_for_game_variant(
                variant_uuid)
        except LookupError:
            return False

        values = self.game.set_from_variant_uuid(database_name, variant_uuid)
        if not values:
            return False

        # print("")
        # for key in sorted(values.keys()):
        #     print(" * {0} = {1}".format(key, values[key]))
        # print("")

        from fsgs.platform import PlatformHandler
        platform_handler = PlatformHandler.create(self.game.platform.id)
        loader = platform_handler.get_loader(self)
        self.config.load(loader.load_values(values))
        return True
開發者ID:EdwardBetts,項目名稱:fs-uae-launcher,代碼行數:28,代碼來源:FSGameSystemContext.py

示例2: create_context

# 需要導入模塊: from fsgs.platform import PlatformHandler [as 別名]
# 或者: from fsgs.platform.PlatformHandler import create [as 別名]
    def create_context(self):
        item = self.items[0]
        variant_uuid = item.configurations[0][0]
        database_name = item.configurations[0][2]
        print("\nitem:\n", item.configurations)
        print("\nitem[0]:\n", item.configurations[0])
        print("\n\nvariant_uuid =", variant_uuid, "\n\n")

        # print("\n\ncreate_context")
        # print("configurations: ", item.configurations)
        # configs = sort_configurations(item.configurations)

        # configs = item.configurations
        # config = configs[0]
        # self.context = GameContext.create_for_game(
        #     item.platform, item.name, config)

        values = fsgs.game.set_from_variant_uuid(database_name, variant_uuid)

        # print("")
        # for key in sorted(values.keys()):
        #     print(" * {0} = {1}".format(key, values[key]))
        # print("")

        self.platform_handler = PlatformHandler.create(fsgs.game.platform.id)
        loader = self.platform_handler.get_loader(fsgs)
        fsgs.config.load(loader.load_values(values))
開發者ID:EdwardBetts,項目名稱:fs-uae-launcher,代碼行數:29,代碼來源:gamemenu.py

示例3: start

# 需要導入模塊: from fsgs.platform import PlatformHandler [as 別名]
# 或者: from fsgs.platform.PlatformHandler import create [as 別名]
    def start(self):
        assert self.thread is None

        platform_handler = PlatformHandler.create(self.fsgs.game.platform.id)
        self.runner = platform_handler.get_runner(self.fsgs)

        device_helper = EnumerateHelper()
        device_helper.default_port_selection(self.runner.ports)

        self.thread = threading.Thread(target=self._thread)
        self.thread.start()
開發者ID:FrodeSolheim,項目名稱:fs-uae-launcher,代碼行數:13,代碼來源:session.py

示例4: run_game

# 需要導入模塊: from fsgs.platform import PlatformHandler [as 別名]
# 或者: from fsgs.platform.PlatformHandler import create [as 別名]
    def run_game(self):
        from fsgs.platform import PlatformHandler
        platform_handler = PlatformHandler.create(self.game.platform.id)
        runner = platform_handler.get_runner(self)

        from fsgs.input.enumeratehelper import EnumerateHelper
        device_helper = EnumerateHelper()
        device_helper.default_port_selection(runner.ports)

        runner.prepare()
        process = runner.run()
        process.wait()
        runner.finish()
開發者ID:EdwardBetts,項目名稱:fs-uae-launcher,代碼行數:15,代碼來源:FSGameSystemContext.py

示例5: load_values

# 需要導入模塊: from fsgs.platform import PlatformHandler [as 別名]
# 或者: from fsgs.platform.PlatformHandler import create [as 別名]
    def load_values(cls, values, uuid=""):
        print("loading config values", values)
        platform_id = values.get("platform", "").lower()

        if platform_id in ["amiga", "cdtv", "cd32"]:
            value_config_loader = ValueConfigLoader(uuid=uuid)
            value_config_loader.load_values(values)
            config = value_config_loader.get_config()
            cls.load(config)
            values["__config_name"] = config.get("__config_name")
        else:
            print("Warning: Non-Amiga game loaded")
            platform_handler = PlatformHandler.create(platform_id)
            loader = platform_handler.get_loader(fsgs)
            fsgs.config.load(loader.load_values(values))
        cls.post_load_values(values)
開發者ID:glaubitz,項目名稱:fs-uae-debian,代碼行數:18,代碼來源:launcher_config.py

示例6: load_values

# 需要導入模塊: from fsgs.platform import PlatformHandler [as 別名]
# 或者: from fsgs.platform.PlatformHandler import create [as 別名]
    def load_values(cls, values, uuid=""):
        print("loading config values", values)
        platform_id = values.get("platform", "").lower()

        if platform_id in ["amiga", "cdtv", "cd32"]:
            value_config_loader = ValueConfigLoader(uuid=uuid)
            value_config_loader.load_values(values)
            config = value_config_loader.get_config()
            cls.load(config)
            config_name = config.get("__config_name", "")

        else:
            print("Warning: Non-Amiga game loaded")
            platform_handler = PlatformHandler.create(platform_id)
            loader = platform_handler.get_loader(fsgs)
            fsgs.config.load(loader.load_values(values))
            config_name = "{0} ({1})".format(
                values.get("game_name"), values.get("platform_name"))

        LauncherSettings.set("config_path", "")

        # print("config is", config)
        # config["x_config_uuid"] = uuid

        if config_name:
            config_name = cls.create_fs_name(config_name)
        # else:
        #     config_name, ext = os.path.splitext(os.path.basename(path))

        if "(" in config_name:
            config_base = config_name.split("(")[0].strip()
        else:
            config_base = config_name
        # game = name

        # if not Config.get("title"):
        #     Config.set("title", config_base)

        LauncherSettings.set("config_base", config_base)
        LauncherSettings.set("config_name", config_name)
        LauncherSettings.set("config_xml_path", "")
        # Settings.set("config_changed", "0")
        cls.set("__changed", "0")
開發者ID:EdwardBetts,項目名稱:fs-uae-launcher,代碼行數:45,代碼來源:launcher_config.py


注:本文中的fsgs.platform.PlatformHandler.create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。