本文整理汇总了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'])
示例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
示例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] = []
示例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)
示例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
示例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