本文整理汇总了Python中spyderlib.widgets.sourcecode.codeeditor.CodeEditor.append方法的典型用法代码示例。如果您正苦于以下问题:Python CodeEditor.append方法的具体用法?Python CodeEditor.append怎么用?Python CodeEditor.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spyderlib.widgets.sourcecode.codeeditor.CodeEditor
的用法示例。
在下文中一共展示了CodeEditor.append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: from spyderlib.widgets.sourcecode.codeeditor import CodeEditor [as 别名]
# 或者: from spyderlib.widgets.sourcecode.codeeditor.CodeEditor import append [as 别名]
class MainWindow(QMainWindow, Ui_MainWindow):
""" The main window of SpikeViewer
"""
def __init__(self, parent = None):
QMainWindow.__init__(self, parent)
QCoreApplication.setOrganizationName('SpykeUtils')
QCoreApplication.setApplicationName('Spyke Viewer')
self.setupUi(self)
self.dir = os.getcwd()
self.console = None
self.progress = ProgressIndicatorDialog(self)
self.provider_factory = DataProvider
self.selections = []
self.provider = None
self.plugin_paths = []
# Drag and Drop for selections menu
self.menuSelections.setAcceptDrops(True)
self.menuSelections.paintEvent =\
self.on_menuSelections_paint
self.menuSelections.mousePressEvent =\
self.on_menuSelections_mousePressed
self.menuSelections.mouseMoveEvent =\
self.on_menuSelections_mouseMoved
self.menuSelections.dragEnterEvent =\
self.on_menuSelections_dragEnter
self.menuSelections.dragMoveEvent =\
self.on_menuSelections_dragMoved
self.menuSelections.dropEvent =\
self.on_menuSelections_drop
self.seldrag_start_pos = None
self.seldrag_selection = None
self.seldrag_target = None
self.seldrag_target_upper = False
# Docks
self.setCentralWidget(None)
# A lot of docks are only needed for the internal database mode
self.navigationDBDock.setVisible(False)
self.filterDBDock.setVisible(False)
self.spikeSortingDock.setVisible(False)
self.waveformsDock.setVisible(False)
self.spikeTrainDock.setVisible(False)
if not hasattr(self, 'internal_database_mode'):
self.removeDockWidget(self.navigationDBDock)
self.removeDockWidget(self.filterDBDock)
self.removeDockWidget(self.spikeSortingDock)
self.removeDockWidget(self.waveformsDock)
self.removeDockWidget(self.spikeTrainDock)
del self.navigationDBDock
del self.filterDBDock
del self.spikeSortingDock
del self.waveformsDock
del self.spikeTrainDock
self.update_view_menu()
if not hasattr(self, 'internal_database_mode'):
self.restore_state()
self.mode_switch()
def update_view_menu(self):
self.menuBar.clear()
self.menuBar.addMenu(self.menuFile)
self.menuBar.addMenu(self.menuSelections)
self.menuView = self.createPopupMenu()
self.menuView.setTitle('View')
self.menuBar.addMenu(self.menuView)
self.menuBar.addMenu(self.menuHelp)
def restore_state(self):
settings = QSettings()
if not settings.contains('windowGeometry') or\
not settings.contains('windowState'):
self.set_initial_layout()
else:
self.restoreGeometry(settings.value('windowGeometry'))
self.restoreState(settings.value('windowState'))
if not settings.contains('pluginPaths'):
if hasattr(sys, 'frozen'):
module_path = os.path.dirname(sys.executable)
else:
file_path = os.path.abspath(os.path.dirname(__file__))
module_path = os.path.dirname(os.path.dirname(file_path))
plugin_path = os.path.join(module_path, 'plugins')
if os.path.isdir(plugin_path):
self.plugin_paths.append(plugin_path)
else:
paths = settings.value('pluginPaths')
#.........这里部分代码省略.........