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


Python LauncherConfig.get方法代码示例

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


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

示例1: __init__

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
    def __init__(self, parent):
        StatusElement.__init__(self, parent)
        self.error_icon = Image("launcher:res/16/error.png")
        self.warning_icon = Image("launcher:res/16/warning_3.png")
        self.notice_icon = Image("launcher:res/16/information.png")
        self.icons = [
            self.error_icon,
            self.warning_icon,
            self.notice_icon,
        ]
        self.coordinates = []
        self.warnings = []
        self.game_notice = ""
        self.variant_notice = ""
        self.variant_warning = ""
        self.variant_error = ""
        self.joy_emu_conflict = ""
        self.using_joy_emu = False
        self.kickstart_file = ""
        self.x_kickstart_file_sha1 = ""
        self.update_available = ""
        self.__error = ""
        self.x_missing_files = ""
        self.download_page = ""
        self.download_file = ""
        self.amiga_model = ""
        self.amiga_model_calculated = ""
        self.chip_memory = ""
        self.chip_memory_calculated = 0
        self.outdated_plugins = []
        self.custom_config = set()
        self.custom_uae_config = set()
        self.settings_config_keys = set()

        plugin_manager = PluginManager.instance()
        for plugin in plugin_manager.plugins():
            if plugin.outdated:
                self.outdated_plugins.append(plugin.name)

        ConfigBehavior(self, [
            "x_game_notice", "x_variant_notice", "x_variant_warning",
            "x_variant_error", "x_joy_emu_conflict", "amiga_model",
            "x_kickstart_file_sha1", "kickstart_file", "download_page",
            "download_file", "x_missing_files", "__error",
            "chip_memory", "jit_compiler"])
        SettingsBehavior(self, ["__update_available"])

        LauncherConfig.add_listener(self)
        for key in JOYSTICK_KEYS:
            self.on_config(key, LauncherConfig.get(key))
        for key in LauncherConfig.keys():
            if LauncherConfig.is_custom_uae_option(key):
                self.on_config(key, LauncherConfig.get(key))
            elif LauncherConfig.is_custom_option(key):
                self.on_config(key, LauncherConfig.get(key))

        LauncherSettings.add_listener(self)
        for key in LauncherSettings.keys():
            if LauncherConfig.is_config_only_option(key):
                self.on_setting(key, LauncherSettings.get(key))
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:62,代码来源:WarningsElement.py

示例2: on_activate_item

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
 def on_activate_item(self, item):
     path = LauncherConfig.get(self.file_key.format(item))
     sha1 = LauncherConfig.get(self.sha1_key.format(item))
     if self.cd_mode:
         pass
     else:
         fsgs.amiga.insert_floppy_in_free_drive(path, sha1=sha1)
开发者ID:,项目名称:,代码行数:9,代码来源:

示例3: get_initial_text

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
 def get_initial_text():
     text = ""
     # FIXME: accessing values directly here, not very nice
     keys = app.settings.values.keys()
     for key in sorted(keys):
         if key in LauncherSettings.default_settings:
             continue
         # if key in LauncherConfig.config_keys:
         #     # print("(settings) ignoring key", key)
         #     text += "\n# {0} is ignored here " \
         #             "(use config dialog instead)\n".format(key)
         if LauncherConfig.is_config_only_option(key):
             text += ("\n# {0} will here function as a global config "
                      "default and may cause\nunexpected problems. It is "
                      "recommended to only use this as a per-config "
                      "option.\n".format(key))
         value = app.settings[key]
         if LauncherConfig.get(key):
             text += "\n# {0} is overridden by current " \
                     "configuration\n".format(key)
         text += "{0} = {1}\n".format(key, value)
         if LauncherConfig.get(key):
             text += "\n"
         if key in LauncherConfig.config_keys:
             text += "\n"
     return text
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:28,代码来源:advanced_settings_page.py

示例4: center_window

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
    def center_window(cls, args, env):
        # FIXME: does not really belong here (dependency loop)
        from launcher.launcher_config import LauncherConfig
        from launcher.launcher_settings import LauncherSettings
        width = (LauncherConfig.get("window_width") or
                 LauncherSettings.get("window_width"))
        height = (LauncherConfig.get("window_height") or
                  LauncherSettings.get("window_height"))
        try:
            width = int(width)
        except:
            width = 960
        try:
            height = int(height)
        except:
            height = 540
        from launcher.ui.launcher_window import LauncherWindow
        if LauncherWindow.current() is None:
            return

        main_w, main_h = LauncherWindow.current().get_size()
        main_x, main_y = LauncherWindow.current().get_position()

        x = main_x + (main_w - width) // 2
        y = main_y + (main_h - height) // 2

        # FIXME: re-implement without wx
        # if windows:
        #     import wx
        #    y += wx.SystemSettings_GetMetric(wx.SYS_CAPTION_Y)

        env[str("SDL_VIDEO_WINDOW_POS")] = str("{0},{1}".format(x, y))
        args.append("--window-x={0}".format(x))
        args.append("--window-y={0}".format(y))
开发者ID:glaubitz,项目名称:fs-uae-debian,代码行数:36,代码来源:FSUAE.py

示例5: on_ext_rom_type_changed

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
 def on_ext_rom_type_changed(self):
     index = self.ext_rom_type_choice.get_index()
     if index == 0:
         if LauncherConfig.get("kickstart_ext_file") == "":
             return
         LauncherConfig.set("kickstart_ext_file", "")
     else:
         LauncherConfig.set("kickstart_ext_file",
                            LauncherConfig.get("x_kickstart_ext_file"))
     LauncherConfig.update_kickstart()
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:12,代码来源:romram.py

示例6: add_config_warnings

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
 def add_config_warnings(self):
     # FIXME: move such warnings to config model code instead
     if self.chip_memory_calculated and \
                     self.chip_memory_calculated < 2048 and \
                     self.amiga_model_calculated in ["A1200", "A4000"]:
         text = gettext("{amiga_model} with < 2 MB chip memory").format(
             amiga_model=self.amiga_model)
         self.warnings.append((WARNING_LEVEL, text, ""))
     if LauncherConfig.get("amiga_model") == "A4000/OS4":
         if LauncherConfig.get("jit_compiler") == "1":
             text = gettext(
                 "JIT compiler with a PPC-only OS is not recommended")
             self.warnings.append((WARNING_LEVEL, text, ""))
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:15,代码来源:WarningsElement.py

示例7: create_list

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
 def create_list(self):
     items = []
     if self.cd_mode:
         max_items = Amiga.MAX_CDROM_IMAGES
     else:
         max_items = Amiga.MAX_FLOPPY_IMAGES
     for i in range(max_items):
         path = LauncherConfig.get(self.file_key.format(i))
         sha1 = LauncherConfig.get(self.sha1_key.format(i))
         if not path:
             continue
         items.append((path, sha1))
     return items
开发者ID:,项目名称:,代码行数:15,代码来源:

示例8: start_local_game

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
    def start_local_game(cls):
        print("START LOCAL GAME")
        print("x_missing_files", LauncherConfig.get("x_missing_files"))

        if LauncherConfig.get("x_missing_files"):
            if LauncherConfig.get("download_file"):
                if LauncherConfig.get("download_terms") and not \
                        Downloader.check_terms_accepted(
                            LauncherConfig.get("download_file"),
                            LauncherConfig.get("download_terms")):
                    from .ui.launcher_window import LauncherWindow
                    dialog = DownloadTermsDialog(LauncherWindow.current(), fsgs)
                    if not dialog.show_modal():
                        return

            elif LauncherConfig.get("download_page"):
                from .ui.launcher_window import LauncherWindow
                # fsui.show_error(_("This game must be downloaded first."))
                DownloadGameWindow(LauncherWindow.current(), fsgs).show()
                return
            else:
                fsui.show_error(
                    gettext("This game variant cannot be started "
                            "because you don't have all required files."))
                return

        platform_id = LauncherConfig.get("platform").lower()
        amiga_platform = platform_id in ["", "amiga", "cdtv", "cd32"]
        if amiga_platform:
            cls.start_local_game_amiga()
        else:
            cls.start_local_game_other()
开发者ID:glaubitz,项目名称:fs-uae-debian,代码行数:34,代码来源:fs_uae_launcher.py

示例9: update_sub_models

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
    def update_sub_models(self, model_id, sub_model_id):
        sub_model_index = 0
        model_id_s = model_id + "/"
        self.sub_model_ids.clear()
        self.sub_model_titles.clear()

        for i, config in enumerate(Amiga.models):
            if config["id"] == model_id:
                self.sub_model_ids.append("")
                self.sub_model_titles.append(config["subtitle"])
            elif config["id"].startswith(model_id_s):
                self.sub_model_ids.append(config["id"].split("/", 1)[1])
                self.sub_model_titles.append(config["subtitle"])
            else:
                continue
            if sub_model_id == self.sub_model_ids[-1]:
                sub_model_index = len(self.sub_model_ids) - 1

        self.sub_model_choice.clear()
        for title in self.sub_model_titles:
            self.sub_model_choice.add_item(title)
        self.sub_model_choice.enable(
            LauncherConfig.get(Option.PLATFORM) in AMIGA_PLATFORMS
            and len(self.sub_model_ids) > 1
        )
        return sub_model_index
开发者ID:,项目名称:,代码行数:28,代码来源:

示例10: start_local_game_other

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
    def start_local_game_other(cls):
        database_name = LauncherConfig.get("__database")
        variant_uuid = LauncherConfig.get("variant_uuid")
        assert variant_uuid

        fsgs.game.set_from_variant_uuid(database_name, variant_uuid)
        platform_handler = PlatformHandler.create(fsgs.game.platform.id)
        runner = platform_handler.get_runner(fsgs)

        task = RunnerTask(runner)
        from .ui.launcher_window import LauncherWindow
        dialog = LaunchDialog(
            LauncherWindow.current(), gettext("Launching Game"), task)
        dialog.show()

        LauncherConfig.set("__running", "1")
        task.start()
开发者ID:glaubitz,项目名称:fs-uae-debian,代码行数:19,代码来源:fs_uae_launcher.py

示例11: new_config

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
 def new_config():
     if openretro or settings.get(Option.PLATFORMS_FEATURE):
         platform_id = LauncherConfig.get(Option.PLATFORM)
     else:
         platform_id = None
     LauncherConfig.load_default_config(platform=platform_id)
     # Settings.set("config_changed", "1")
     LauncherSettings.set("parent_uuid", "")
开发者ID:,项目名称:,代码行数:10,代码来源:

示例12: __init__

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
    def __init__(self, parent):
        StatusElement.__init__(self, parent)
        # self.set_min_width(140)
        self.layout = HorizontalLayout()
        self.icon = Image("launcher:res/16/world_link.png")
        self.right_icon = Image("launcher:res/16/drop_down_arrow.png")
        self.right_icon_disabled = Image(
            "launcher:res/16/drop_down_arrow_disabled.png")
        # self.inactive_icon = self.active_icon.grey_scale()

        self.text = gettext("Web Links")

        LauncherConfig.add_listener(self)
        self.on_config("protection", LauncherConfig.get("protection"))

        self.have = set()
        for key in url_keys:
            self.on_config(key, LauncherConfig.get(key))
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:20,代码来源:WebLinkElement.py

示例13: __init__

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
    def __init__(self, parent, platforms):
        self.platforms = set(platforms)
        parent.__platform_behavior = self
        self._parent = weakref.ref(parent)
        self.on_config("platform", LauncherConfig.get("platform"))
        LauncherConfig.add_listener(self)

        # FIXME: We need to disconnect the listener
        parent.destroyed.connect(self.on_destroy)
开发者ID:,项目名称:,代码行数:11,代码来源:

示例14: on_left_down

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
 def on_left_down(self):
     if len(self.have) == 0:
         return
     menu = Menu()
     for key, description in url_descriptions:
         value = LauncherConfig.get(key, "")
         if value:
             menu.add_item(description, create_open_url_function(value))
     self.popup_menu(menu)
开发者ID:,项目名称:,代码行数:11,代码来源:

示例15: update_environment_with_centering_info

# 需要导入模块: from launcher.launcher_config import LauncherConfig [as 别名]
# 或者: from launcher.launcher_config.LauncherConfig import get [as 别名]
    def update_environment_with_centering_info(self, env):
        # FIXME: does not really belong here (dependency loop)
        from launcher.launcher_config import LauncherConfig
        from launcher.launcher_settings import LauncherSettings

        width = LauncherConfig.get("window_width") or LauncherSettings.get(
            "window_width"
        )
        height = LauncherConfig.get("window_height") or LauncherSettings.get(
            "window_height"
        )
        try:
            width = int(width)
        except:
            width = 960
        try:
            height = int(height)
        except:
            height = 540
        from launcher.ui.launcherwindow import LauncherWindow

        if LauncherWindow.current() is None:
            return

        main_w, main_h = LauncherWindow.current().get_size()
        main_x, main_y = LauncherWindow.current().get_position()

        x = main_x + (main_w - width) // 2
        y = main_y + (main_h - height) // 2

        # FIXME: REMOVE
        env["FSGS_WINDOW_X"] = str(x)
        env["FSGS_WINDOW_Y"] = str(y)

        # FIXME: REMOVE
        env["SDL_VIDEO_WINDOW_POS"] = str("{0},{1}".format(x, y))
        env["FSGS_WINDOW_POS"] = str("{0},{1}".format(x, y))

        env["FSGS_WINDOW_CENTER"] = "{0},{1}".format(
            main_x + main_w // 2, main_y + main_h // 2
        )
开发者ID:FrodeSolheim,项目名称:fs-uae-launcher,代码行数:43,代码来源:gamedriver.py


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