本文整理汇总了Python中spyderlib.config.CONF.set方法的典型用法代码示例。如果您正苦于以下问题:Python CONF.set方法的具体用法?Python CONF.set怎么用?Python CONF.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spyderlib.config.CONF
的用法示例。
在下文中一共展示了CONF.set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: toggle_wrap_mode
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def toggle_wrap_mode(self, checked):
"""Toggle wrap mode"""
if self.tabwidget is None:
return
for editor in self.editors:
editor.toggle_wrap_mode(checked)
CONF.set(self.ID, 'wrap', checked)
示例2: option_changed
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def option_changed(self, option, value):
"""
Change a plugin option in configuration file
Use a SIGNAL to call it, e.g.:
self.emit(SIGNAL('option_changed'), 'show_all', checked)
"""
CONF.set(self.ID, option, value)
示例3: toggle_codecompletion
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def toggle_codecompletion(self, checked):
"""Toggle automatic code completion"""
if self.tabwidget is None:
return
for shell in self.shells:
shell.shell.set_codecompletion_auto(checked)
CONF.set(self.ID, 'codecompletion/auto', checked)
示例4: toggle_codecompletion
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def toggle_codecompletion(self, checked):
"""Toggle code completion"""
if self.tabwidget is None:
return
for shell in self.shells:
shell.shell.set_codecompletion(checked)
CONF.set(self.ID, 'autocompletion/enabled', checked)
示例5: set_option
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def set_option(self, option, value):
"""
Set a plugin option in configuration file
Use a SIGNAL to call it, e.g.:
plugin.sig_option_changed.emit('show_all', checked)
"""
CONF.set(self.CONF_SECTION, str(option), value)
示例6: toggle_wrap_mode
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def toggle_wrap_mode(self, checked):
"""Toggle wrap mode"""
if self.tabwidget is None:
return
for shell in self.shells:
shell.shell.toggle_wrap_mode(checked)
CONF.set(self.ID, 'wrap', checked)
示例7: toggle_codecompletion_enter
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def toggle_codecompletion_enter(self, checked):
"""Toggle Enter key for code completion"""
if self.tabwidget is None:
return
for shell in self.shells:
shell.shell.set_codecompletion_enter(checked)
CONF.set(self.ID, 'autocompletion/enter-key', checked)
示例8: run
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def run(self, session):
from spyderlib import spyder
from spyderlib.config import CONF
cs.exit_if_not_exists(session)
app = spyder.initialize()
# This should come from our command line parser, however, Spyder does
# not provide a way to get the argument parser but only the parsed
# arguments.
opts = {'working_directory': cs.path(),
'debug': False,
'profile': False,
'multithreaded': False,
'light': False,
'new_instance': True}
# The python executable is set explicitly here, because Spyder tends
# not to pick up the one used in a virtualenv. This should be set in a
# profile in order to not mess with the user's settings.
CONF.set('console', 'pythonexecutable', sys.executable)
main = spyder.MainWindow(Bunch(opts))
main.setup()
main.show()
main.open_file(cs.path(session))
app.exec_()
示例9: toggle_calltips
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def toggle_calltips(self, checked):
"""Toggle calltips"""
if self.tabwidget is None:
return
for shell in self.shells:
shell.shell.set_calltips(checked)
CONF.set(self.ID, 'calltips', checked)
示例10: setup_api
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def setup_api(self):
"""Load and prepare Python API"""
if self.lexer() is None:
return
self.api = QsciAPIs(self.lexer())
is_api_ready = False
api_path = CONF.get('editor', 'api')
if not osp.isfile(api_path):
from spyderlib.config import DATA_PATH
api_path = osp.join(DATA_PATH, 'python.api')
if osp.isfile(api_path):
CONF.set('editor', 'api', api_path)
else:
return False
api_size = CONF.get('editor', 'api_size', None)
current_api_size = os.stat(api_path).st_size
if api_size is not None and api_size == current_api_size:
if self.api.isPrepared():
is_api_ready = self.api.loadPrepared()
else:
CONF.set('editor', 'api_size', current_api_size)
if not is_api_ready:
if self.api.load(api_path):
self.api.prepare()
self.connect(self.api, SIGNAL("apiPreparationFinished()"),
self.api.savePrepared)
return is_api_ready
示例11: change_exteditor
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def change_exteditor(self):
"""Change external editor path"""
path, valid = QInputDialog.getText(self, self.tr('External editor'),
self.tr('External editor executable path:'),
QLineEdit.Normal,
CONF.get(self.ID, 'external_editor/path'))
if valid:
CONF.set(self.ID, 'external_editor/path', unicode(path))
示例12: change_history_depth
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def change_history_depth(self):
"Change history max entries"""
depth, valid = QInputDialog.getInteger(self, self.tr('History'),
self.tr('Maximum entries'),
CONF.get(self.ID, 'max_entries'),
10, 10000)
if valid:
CONF.set(self.ID, 'max_entries', depth)
示例13: save_config
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def save_config(self):
"""Save configuration: opened projects & tree widget state"""
data = self.get_project_config()
cPickle.dump(data, file(self.DATAPATH, 'w'))
CONF.set(self.ID, 'expanded_state',
self.treewidget.get_expanded_state())
CONF.set(self.ID, 'scrollbar_position',
self.treewidget.get_scrollbar_position())
示例14: change_max_line_count
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def change_max_line_count(self):
"Change maximum line count"""
mlc, valid = QInputDialog.getInteger(self, self.tr('Buffer'),
self.tr('Maximum line count'),
CONF.get(self.ID, 'max_line_count'),
10, 1000000)
if valid:
self.shell.setMaximumBlockCount(mlc)
CONF.set(self.ID, 'max_line_count', mlc)
示例15: _get_run_configurations
# 需要导入模块: from spyderlib.config import CONF [as 别名]
# 或者: from spyderlib.config.CONF import set [as 别名]
def _get_run_configurations():
history_count = CONF.get('run', 'history', 20)
try:
return [(filename, options)
for filename, options in CONF.get('run', 'configurations', [])
if osp.isfile(filename)][:history_count]
except ValueError:
CONF.set('run', 'configurations', [])
return []