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


Python CONF.options方法代码示例

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


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

示例1: update_server_list

# 需要导入模块: from spyder.config.main import CONF [as 别名]
# 或者: from spyder.config.main.CONF import options [as 别名]
 def update_server_list(self):
     for language in CONF.options(self.CONF_SECTION):
         config = {'status': self.STOPPED,
                   'config': self.get_option(language),
                   'instance': None}
         if language not in self.clients:
             self.clients[language] = config
             self.register_queue[language] = []
         else:
             logger.debug(
                     self.clients[language]['config'] != config['config'])
             current_config = self.clients[language]['config']
             new_config = config['config']
             configuration_diff = (current_config['configurations'] !=
                                   new_config['configurations'])
             restart_diff = ['cmd', 'args', 'host', 'port', 'external']
             restart = any([current_config[x] != new_config[x]
                            for x in restart_diff])
             if restart:
                 if self.clients[language]['status'] == self.STOPPED:
                     self.clients[language] = config
                 elif self.clients[language]['status'] == self.RUNNING:
                     self.close_client(language)
                     self.clients[language] = config
                     self.start_lsp_client(language)
             else:
                 if configuration_diff:
                     if self.clients[language]['status'] == self.RUNNING:
                         client = self.clients[language]['instance']
                         client.send_plugin_configurations(
                             new_config['configurations'])
开发者ID:cfanpc,项目名称:spyder,代码行数:33,代码来源:lspmanager.py

示例2: get_languages

# 需要导入模块: from spyder.config.main import CONF [as 别名]
# 或者: from spyder.config.main.CONF import options [as 别名]
 def get_languages(self):
     """
     Get the list of languages we need to start servers and create
     clients for.
     """
     languages = ['python']
     all_options = CONF.options(self.CONF_SECTION)
     for option in all_options:
         if option in [l.lower() for l in LSP_LANGUAGES]:
             languages.append(option)
     return languages
开发者ID:impact27,项目名称:spyder,代码行数:13,代码来源:manager.py

示例3: __init__

# 需要导入模块: from spyder.config.main import CONF [as 别名]
# 或者: from spyder.config.main.CONF import options [as 别名]
    def __init__(self, parent):
        SpyderPluginWidget.__init__(self, parent)
        self.options_button.hide()
        self.hide()

        self.lsp_plugins = {}
        self.clients = {}
        self.requests = {}
        self.register_queue = {}
        for option in CONF.options(self.CONF_SECTION):
            self.clients[option] = {'status': self.STOPPED,
                                    'config': self.get_option(option),
                                    'instance': None}
            self.register_queue[option] = []
开发者ID:cfanpc,项目名称:spyder,代码行数:16,代码来源:lspmanager.py

示例4: iter_shortcuts

# 需要导入模块: from spyder.config.main import CONF [as 别名]
# 或者: from spyder.config.main.CONF import options [as 别名]
def iter_shortcuts():
    """Iterate over keyboard shortcuts"""
    for option in CONF.options('shortcuts'):
        context, name = option.split("/", 1)
        yield context, name, get_shortcut(context, name)
开发者ID:0xBADCA7,项目名称:spyder,代码行数:7,代码来源:gui.py

示例5: iter_servers

# 需要导入模块: from spyder.config.main import CONF [as 别名]
# 或者: from spyder.config.main.CONF import options [as 别名]
def iter_servers():
    for option in CONF.options('lsp-server'):
        server = LSPServer(language=option)
        server.load()
        yield server
开发者ID:cfanpc,项目名称:spyder,代码行数:7,代码来源:lspmanager.py

示例6: iter_servers

# 需要导入模块: from spyder.config.main import CONF [as 别名]
# 或者: from spyder.config.main.CONF import options [as 别名]
def iter_servers():
    for option in CONF.options('lsp-server'):
        if option in [l.lower() for l in LSP_LANGUAGES]:
            server = LSPServer(language=option)
            server.load()
            yield server
开发者ID:pijyoi,项目名称:spyder,代码行数:8,代码来源:languageserver.py


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