本文整理汇总了Python中spyderlib.config.CONF类的典型用法代码示例。如果您正苦于以下问题:Python CONF类的具体用法?Python CONF怎么用?Python CONF使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CONF类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: toggle_codecompletion
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)
开发者ID:cheesinglee,项目名称:spyder,代码行数:7,代码来源:externalconsole.py
示例2: toggle_codecompletion_enter
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)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:7,代码来源:externalconsole.py
示例3: open_interpreter_at_startup
def open_interpreter_at_startup(self):
"""Open an interpreter at startup, IPython if module is available"""
if CONF.get(self.ID, 'open_ipython_at_startup') \
and programs.is_module_installed("IPython"):
self.open_ipython()
if CONF.get(self.ID, 'open_python_at_startup'):
self.open_interpreter()
开发者ID:cheesinglee,项目名称:spyder,代码行数:7,代码来源:externalconsole.py
示例4: toggle_wrap_mode
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)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:7,代码来源:externalconsole.py
示例5: option_changed
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)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:7,代码来源:__init__.py
示例6: run
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_()
开发者ID:ufo-kit,项目名称:concert,代码行数:28,代码来源:spyder.py
示例7: __init__
def __init__(self, parent):
PluginWidget.__init__(self, parent)
# Read-only editor
self.editor = QsciEditor(self)
self.editor.setup_editor(linenumbers=False, language='py',
code_folding=True)
self.connect(self.editor, SIGNAL("focus_changed()"),
lambda: self.emit(SIGNAL("focus_changed()")))
self.editor.setReadOnly(True)
self.editor.set_font( get_font(self.ID) )
self.editor.toggle_wrap_mode( CONF.get(self.ID, 'wrap') )
# Add entries to read-only editor context-menu
font_action = create_action(self, translate("Editor", "&Font..."), None,
'font.png',
translate("Editor", "Set font style"),
triggered=self.change_font)
wrap_action = create_action(self, translate("Editor", "Wrap lines"),
toggled=self.toggle_wrap_mode)
wrap_action.setChecked( CONF.get(self.ID, 'wrap') )
self.editor.readonly_menu.addSeparator()
add_actions(self.editor.readonly_menu, (font_action, wrap_action))
# Find/replace widget
self.find_widget = FindReplace(self)
self.find_widget.set_editor(self.editor)
self.find_widget.hide()
开发者ID:Brainsciences,项目名称:luminoso,代码行数:28,代码来源:__init__.py
示例8: toggle_calltips
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)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:7,代码来源:externalconsole.py
示例9: toggle_wrap_mode
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)
开发者ID:cheesinglee,项目名称:spyder,代码行数:7,代码来源:history.py
示例10: show_banner
def show_banner(self):
"""Banner for IPython widgets with pylab message"""
from IPython.core.usage import default_gui_banner
banner = default_gui_banner
pylab_o = CONF.get('ipython_console', 'pylab', True)
autoload_pylab_o = CONF.get('ipython_console', 'pylab/autoload', True)
mpl_installed = programs.is_module_installed('matplotlib')
if mpl_installed and (pylab_o and autoload_pylab_o):
backend_o = CONF.get('ipython_console', 'pylab/backend', 0)
backends = {0: 'module://IPython.zmq.pylab.backend_inline',
1: 'Qt4Agg', 2: 'Qt4Agg', 3: 'MacOSX', 4: 'GTKAgg',
5: 'WXAgg', 6: 'TKAgg'}
pylab_013_message = """
Welcome to pylab, a matplotlib-based Python environment [backend: %s].
For more information, type 'help(pylab)'.\n""" % backends[backend_o]
pylab_1_message = """
Populating the interactive namespace from numpy and matplotlib"""
if programs.is_module_installed('IPython', '>=1.0'):
banner = banner + pylab_1_message
else:
banner = banner + pylab_013_message
sympy_o = CONF.get('ipython_console', 'symbolic_math', True)
if sympy_o:
lines = """
These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
"""
banner = banner + lines
return banner
开发者ID:jromang,项目名称:spyderlib,代码行数:35,代码来源:ipython.py
示例11: __init__
def __init__(self, parent):
PydocBrowser.__init__(self, parent)
SpyderPluginMixin.__init__(self, parent)
self.set_zoom_factor(CONF.get(self.ID, 'zoom_factor'))
self.url_combo.setMaxCount(CONF.get(self.ID, 'max_history_entries'))
self.url_combo.addItems( self.load_history() )
开发者ID:cheesinglee,项目名称:spyder,代码行数:7,代码来源:onlinehelp.py
示例12: toggle_codecompletion
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)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:7,代码来源:externalconsole.py
示例13: long_banner
def long_banner(self):
"""Banner for IPython widgets with pylab message"""
from IPython.core.usage import default_gui_banner
banner = default_gui_banner
pylab_o = CONF.get('ipython_console', 'pylab', True)
autoload_pylab_o = CONF.get('ipython_console', 'pylab/autoload', True)
mpl_installed = programs.is_module_installed('matplotlib')
if mpl_installed and (pylab_o and autoload_pylab_o):
pylab_message = ("\nPopulating the interactive namespace from "
"numpy and matplotlib")
banner = banner + pylab_message
sympy_o = CONF.get('ipython_console', 'symbolic_math', True)
if sympy_o:
lines = """
These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
"""
banner = banner + lines
return banner
开发者ID:beyondliyang,项目名称:spyder,代码行数:25,代码来源:ipython.py
示例14: set_option
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)
开发者ID:ymarfoq,项目名称:outilACVDesagregation,代码行数:7,代码来源:__init__.py
示例15: change_exteditor
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))
开发者ID:cheesinglee,项目名称:spyder,代码行数:8,代码来源:console.py
示例16: save_config
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())
开发者ID:cheesinglee,项目名称:spyder,代码行数:8,代码来源:projectexplorer.py
示例17: change_history_depth
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)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:8,代码来源:pylintgui.py
示例18: setup
def setup(self):
"""Configure QTextEdit"""
# Calltips
self.calltip_size = CONF.get('shell_appearance', 'calltips/size')
self.calltip_font = get_font('shell_appearance', 'calltips')
# Completion
self.completion_size = CONF.get('shell_appearance', 'completion/size')
self.completion_font = get_font('shell_appearance', 'completion')
开发者ID:Brainsciences,项目名称:luminoso,代码行数:8,代码来源:qtebase.py
示例19: change_max_line_count
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)
开发者ID:cheesinglee,项目名称:spyder,代码行数:9,代码来源:console.py
示例20: setup
def setup(self):
"""Configure QPlainTextEdit"""
# Calltips
self.calltip_size = CONF.get('shell_appearance', 'calltips/size')
self.calltip_font = get_font('shell_appearance', 'calltips')
# Completion
size = CONF.get('shell_appearance', 'completion/size')
font = get_font('shell_appearance', 'completion')
self.completion_widget.setup_appearance(size, font)
开发者ID:cheesinglee,项目名称:spyder,代码行数:9,代码来源:qtebase.py
注:本文中的spyderlib.config.CONF类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论