本文整理汇总了Python中sip.delete函数的典型用法代码示例。如果您正苦于以下问题:Python delete函数的具体用法?Python delete怎么用?Python delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delete函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: delete
def delete(self):
"""
Remove this part from our score.
"""
del self.l.part
sip.delete(self.w)
sip.delete(self.l)
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:7,代码来源:scorewiz.py
示例2: main
def main():
import gc
import sip
from AnyQt.QtWidgets import QApplication
from Orange.classification import (LogisticRegressionLearner, SVMLearner,
NuSVMLearner)
app = QApplication([])
w = OWROCAnalysis()
w.show()
w.raise_()
# data = Orange.data.Table("iris")
data = Orange.data.Table("ionosphere")
results = Orange.evaluation.CrossValidation(
data,
[LogisticRegressionLearner(),
LogisticRegressionLearner(penalty="l1"),
SVMLearner(probability=True),
NuSVMLearner(probability=True)],
k=5,
store_data=True,
)
results.learner_names = ["Logistic", "Logistic (L1 reg.)", "SVM", "NuSVM"]
w.set_results(results)
rval = app.exec_()
w.deleteLater()
sip.delete(w)
del w
app.processEvents()
sip.delete(app)
del app
gc.collect()
return rval
开发者ID:randxie,项目名称:orange3,代码行数:35,代码来源:owrocanalysis.py
示例3: main
def main():
import sip
from PyQt4.QtGui import QApplication
from Orange.classification import logistic_regression, svm
from Orange.evaluation import testing
app = QApplication([])
w = OWLiftCurve()
w.show()
w.raise_()
data = Orange.data.Table("ionosphere")
results = testing.CrossValidation(
data,
[logistic_regression.LogisticRegressionLearner(penalty="l2"),
logistic_regression.LogisticRegressionLearner(penalty="l1"),
svm.SVMLearner(probability=True),
svm.NuSVMLearner(probability=True)
],
store_data=True
)
results.fitter_names = ["LR l2", "LR l1", "SVM", "Nu SVM"]
w.set_results(results)
rval = app.exec_()
sip.delete(w)
del w
app.processEvents()
del app
return rval
开发者ID:CHANAYA,项目名称:orange3,代码行数:30,代码来源:owliftcurve.py
示例4: __init__
def __init__(self, main_window):
super(backend_settings, self).__init__(main_window,
ui=u'widgets.backend_settings')
self.tab_name = u'__backend_settings__'
for backend_type in backend._backend_types:
try:
_backend = backend.get_backend_class(self.experiment,
backend_type)
except:
_backend = None
layout = getattr(self.ui, u'layout_%s' % backend_type)
label = getattr(self.ui, u'label_%s' % backend_type)
# Horribly ugly way to clear the previous settings
while layout.count() > 1:
w = layout.itemAt(1)
layout.removeItem(w)
w.widget().hide()
sip.delete(w)
if _backend is None:
label.setText(_(u"Failed to load backend"))
elif not hasattr(_backend, u"settings") or _backend.settings == \
None:
label.setText(_(u"No settings for %s") % _backend.__name__)
else:
label.setText(_(u"Settings for %s:") % _backend.__name__)
layout.addWidget(settings_widget(self.main_window,
_backend.settings))
开发者ID:JdenHartog,项目名称:OpenSesame,代码行数:30,代码来源:backend_settings.py
示例5: __init__
def __init__(self, parent=None):
super(QtWidgets.QWidget, self).__init__(parent)
self.setupUi(self)
self.state = True
self.name = None
self.psf, self. dcd = "", ""
self.allSasas = []
self.totalFramesToProcess = 0
sip.delete(self.sasaProgressBar)
self.sasaProgressBar = PbWidget(total=100)
self.sasaProgressBar.setProperty("value", 0)
self.sasaProgressBar.setTextVisible(True)
self.sasaProgressBar.setInvertedAppearance(False)
self.sasaProgressBar.setObjectName("sasaProgressBar")
self.previewPlot = SimplePlotter(None, width=4, height=2, dpi=70)
self.graphGridLayout.addWidget(self.previewPlot)
self.gridLayout.addWidget(self.sasaProgressBar, 8, 1, 1, 2)
self.calcSasaButton.clicked.connect(self.calculateSasa)
self.loadDataButton.clicked.connect(self.loadData)
self.clearDataButton.clicked.connect(self.clearData)
self.savePlotButton.clicked.connect(self.savePlot)
self.exportDataButton.clicked.connect(self.exportData)
self.topoloader = TopoTrajLoaderDialog()
开发者ID:maxscheurer,项目名称:pycontact,代码行数:25,代码来源:SasaWidgets.py
示例6: move_itemsAcross
def move_itemsAcross(self, source, modifiers):
""" Create new tree items and populate the target tree. Originally made
for moving items from fileDataTree to workingDataTree, but then modified
to copy items when the move is internal in workingDataTree and Ctrl is
pressed.
"""
if (source==self.ui.workingDataTree) and (modifiers==QtCore.Qt.ControlModifier):
# Copy internally
#print 'copying'
targetItems = []
for item in self.copyItems:
i = h5Item([str(item.text(0))])
i.data = item.data
targetItems.append(i)
parentIndex = self.ui.workingDataTree.indexFromItem(self.dragTargetParent)
for row in np.arange(0, len(self.copyItems)):
index = self.ui.workingDataTree.model().index(self.dragTargetRow+row, 0, parentIndex)
temp_item = self.ui.workingDataTree.itemFromIndex(QtCore.QModelIndex(index))
sip.delete(temp_item)
if parentIndex.isValid():
self.make_nameUnique(self.dragTargetParent, targetItems[row], targetItems[row].text(0))
self.dragTargetParent.insertChild(index.row(), targetItems[row])
originalParentWidget = self.copyItems[row]
h5.populate_h5copyItems(self, originalParentWidget, targetItems[row])
else:
self.make_nameUnique(self.ui.workingDataTree.invisibleRootItem(), targetItems[row], targetItems[row].text(0))
self.ui.workingDataTree.insertTopLevelItem(index.row(), targetItems[row])
originalParentWidget = self.copyItems[row]
h5.populate_h5copyItems(self, originalParentWidget, targetItems[row])
elif source==self.ui.workingDataTree:
pass
else:
# Move across
#print 'moving'
targetItems = []
for item in self.dragItems:
i = h5Item([str(item[1])])
i.path = item[0]
i.listIndex = item[2]
i.originalIndex = item[3]
i.data = item[4]
i.attrs = item[5]
#item = i[0]
#item.originalIndex = i[1]
targetItems.append(i)
parentIndex = self.ui.workingDataTree.indexFromItem(self.dragTargetParent)
for row in np.arange(0, len(self.dragItems)):
index = self.ui.workingDataTree.model().index(self.dragTargetRow+row, 0, parentIndex)
temp_item = self.ui.workingDataTree.itemFromIndex(QtCore.QModelIndex(index))
sip.delete(temp_item)
if parentIndex.isValid():
self.make_nameUnique(self.dragTargetParent, targetItems[row], targetItems[row].text(0))
self.dragTargetParent.insertChild(index.row(), targetItems[row])
originalParentWidget = self.ui.fileDataTree.itemFromIndex(QtCore.QModelIndex(targetItems[row].originalIndex))
h5.populate_h5dragItems(self, originalParentWidget, targetItems[row])
else:
self.make_nameUnique(self.ui.workingDataTree.invisibleRootItem(), targetItems[row], targetItems[row].text(0))
self.ui.workingDataTree.insertTopLevelItem(index.row(), targetItems[row])
originalParentWidget = self.ui.fileDataTree.itemFromIndex(QtCore.QModelIndex(targetItems[row].originalIndex))
h5.populate_h5dragItems(self, originalParentWidget, targetItems[row])
开发者ID:ineuron,项目名称:NeuroDAQ-Analysis,代码行数:60,代码来源:mainWindow.py
示例7: plotClusterSelection
def plotClusterSelection(self, index, boolean=False):
"""
Allow to plot peak and cluster tables
"""
if not index.isValid():
return
string = str(index.data().toString())#.model().data(index.parent(), Qt.DisplayRole).toString()
if string in ("fragments/adducts:","isotopic cluster:"):
return
data = string.split('/')
#print data
prec=float(data[0])
rt = float(data[1])
#print prec, rt
peaks=self.getElementsToPlot(flags='peak', prec=prec, rt=rt)
pw = ClusterWidget(peaks, self.view)#MSQtCanvas(peaks, "[email protected]%s/%s"%(str(prec), str(rt)), labels={'bottom':'RT(s)', 'left':'INTENSITY'}, flags='peak')
QObject.connect(qApp.instance(), SIGNAL('redraw()'), pw.widget.mainWidget.redraw)
title="[email protected]%s/%s"%(str(prec), str(rt))
win=self.view.mdiArea.activeSubWindow()
isMax=False
if win is not None and boolean:
isMax=win.isMaximized()
w=win.widget()
#w.setParent(None)
sip.delete(w)#
#del w
win.setWidget(pw)
else:
self.view.addMdiSubWindow(MSView(pw), title, isMax)
self.view.mdiArea.tileSubWindows()
开发者ID:jerkos,项目名称:metms,代码行数:32,代码来源:MetDockWidgetControl.py
示例8: move_itemsAcross
def move_itemsAcross(self):
""" Create new tree items and populate the target tree
"""
targetItems = []
for item in self.dragItems:
i = h5Item([str(item[1])])
i.path = item[0]
i.listIndex = item[2]
i.originalIndex = item[3]
targetItems.append(i)
parentIndex = self.ui.workingDataTree.indexFromItem(self.dragTargetParent)
for row in np.arange(0, len(self.dragItems)):
index = self.ui.workingDataTree.model().index(self.dragTargetRow+row, 0, parentIndex)
temp_item = self.ui.workingDataTree.itemFromIndex(QtCore.QModelIndex(index))
sip.delete(temp_item)
if parentIndex.isValid():
self.make_nameUnique(self.dragTargetParent, targetItems[row], targetItems[row].text(0))
self.dragTargetParent.insertChild(index.row(), targetItems[row])
originalParentWidget = self.ui.fileDataTree.itemFromIndex(QtCore.QModelIndex(targetItems[row].originalIndex))
h5.populate_h5dragItems(self, originalParentWidget, targetItems[row])
else:
self.make_nameUnique(self.ui.workingDataTree.invisibleRootItem(), targetItems[row], targetItems[row].text(0))
self.ui.workingDataTree.insertTopLevelItem(index.row(), targetItems[row])
originalParentWidget = self.ui.fileDataTree.itemFromIndex(QtCore.QModelIndex(targetItems[row].originalIndex))
h5.populate_h5dragItems(self, originalParentWidget, targetItems[row])
开发者ID:de278,项目名称:NeuroDAQ-Analysis,代码行数:25,代码来源:mainWindow.py
示例9: plotSelection
def plotSelection(self, index, boolean=False):
"""
Allow to plot spectrum
"""
if not index.isValid():
return
chromas=self.getElementsToPlot(flags='spectra', index=index.row())
title="[email protected]%s"%str(chromas[0].rtmin)
legend={'bottom':'m/z', 'left':'INTENSITY'}
flags='spectra'
#useOpenGL=False
pw = MSQtCanvas(chromas, title, labels=legend, flags=flags)#, useOpenGL=useOpenGL)
QObject.connect(qApp.instance(), SIGNAL('redraw()'), pw.redraw)
a=self.view.mdiArea.activeSubWindow()
isMax=False
if a is not None and boolean:
isMax=a.isMaximized()
w=a.widget()
#w.connect(w, SIGNAL('destroyed (QObject *)'), self.destroyed)
#w.setParent(None)
#print "parent of w just before elimination", w.parent()
sip.delete(w)#; del w
del w
a.setWidget(pw)
#a.close()
else:
self.view.addMdiSubWindow(pw, title, isMax)
self.view.mdiArea.tileSubWindows()
开发者ID:jerkos,项目名称:metms,代码行数:29,代码来源:MetDockWidgetControl.py
示例10: plotPeakSelection
def plotPeakSelection(self, index, boolean=False):
"""
Allow to plot peak and peak tables
"""
if not index.isValid():
return
data = index.data().toString().split("/")
prec, rt =float(data[0]), float(data[1])
peaks=self.getElementsToPlot(flags='peak', prec=prec, rt=rt)
pw = MSQtCanvas(peaks, "[email protected]%s/%s"%(str(prec), str(rt)),
labels={'bottom':'RT(s)', 'left':'INTENSITY'},
flags='peak')
QObject.connect(qApp.instance(), SIGNAL('redraw()'), pw.redraw)
title="[email protected]%s/%s"%(str(prec), str(rt))
win=self.view.mdiArea.activeSubWindow()
isMax=False
if win is not None and boolean:
isMax=win.isMaximized()
w=win.widget()
#w.connect(w, SIGNAL('destroyed (QObject *)'), self.destroyed)
#w.setParent(None)
sip.delete(w)
del w
win.setWidget(MSView(pw))
#win.close()
else:
self.view.addMdiSubWindow(MSView(pw), title, isMax)
self.view.mdiArea.tileSubWindows()
开发者ID:jerkos,项目名称:metms,代码行数:30,代码来源:MetDockWidgetControl.py
示例11: clearLayout
def clearLayout(self):
if self.layout() is not None:
old_layout = self.layout()
for i in reversed(range(old_layout.count())):
old_layout.itemAt(i).widget().setParent(None)
import sip
sip.delete(old_layout)
开发者ID:Persipaani,项目名称:UI_projektityo,代码行数:7,代码来源:updatableWidget.py
示例12: test_main
def test_main(argv=None):
import sys
import sip
argv = sys.argv[1:] if argv is None else argv
if argv:
filename = argv[0]
else:
filename = "iris"
data = Orange.data.Table(filename)
app = QApplication([])
w = OWLinearProjection()
w.set_data(data)
w.set_subset_data(data[::10])
w.handleNewSignals()
w.show()
w.raise_()
r = app.exec()
w.set_data(None)
w.saveSettings()
sip.delete(w)
del w
return r
开发者ID:fdion,项目名称:orange3,代码行数:25,代码来源:owlinearprojection.py
示例13: _request_page
def _request_page(self):
self.n += 1
print('Попытка:', self.n)
sip.delete(self.page)
self.page = QWebPage(self)
self.page.loadFinished.connect(self._check_goods)
self.page.mainFrame().load(QUrl(self.url))
开发者ID:bravikov,项目名称:pybravikov,代码行数:7,代码来源:jd_available.py
示例14: plotAttribute
def plotAttribute(self):
"""Plots the selected attribute."""
sip.delete(self.contactPlotter)
self.contactPlotter = ContactPlotter(None, width=4, height=2, dpi=70)
if self.attributeBox.currentText() == "Score":
self.contactPlotter.plot_contact_figure(self.contact)
self.plotGridLayout.addWidget(self.contactPlotter)
开发者ID:maxscheurer,项目名称:pycontact,代码行数:7,代码来源:DetailWidget.py
示例15: qt
def qt():
application = QApplication([])
yield application
application.exit()
# If we don't force deletion of the C++ wrapped object, it causes the test suite to eventually crash
# Never ever remove this!!
sip.delete(application)
开发者ID:testinfected,项目名称:cute,代码行数:7,代码来源:conftest.py
示例16: main
def main():
import sip
from AnyQt.QtWidgets import QApplication
from Orange.classification import (LogisticRegressionLearner, SVMLearner,
NuSVMLearner)
app = QApplication([])
w = OWCalibrationPlot()
w.show()
w.raise_()
data = Orange.data.Table("ionosphere")
results = Orange.evaluation.CrossValidation(
data,
[LogisticRegressionLearner(penalty="l2"),
LogisticRegressionLearner(penalty="l1"),
SVMLearner(probability=True),
NuSVMLearner(probability=True)
],
store_data=True
)
results.learner_names = ["LR l2", "LR l1", "SVM", "Nu SVM"]
w.set_results(results)
rval = app.exec_()
sip.delete(w)
del w
app.processEvents()
del app
return rval
开发者ID:RachitKansal,项目名称:orange3,代码行数:30,代码来源:owcalibrationplot.py
示例17: _display
def _display(self):
"""
Rebuild the speaker panel from scratch. Existing buttons and stuff
will be destroyed before new ones are created.
"""
self.btn2spkr = {}
self.spkr2btn = {}
sip.delete(self.widget())
widget = QtGui.QWidget()
layout = QtGui.QVBoxLayout(widget)
buttonGroup = QtGui.QButtonGroup(widget)
buttonGroup.buttonClicked.connect(self._setSelectedSpeaker)
for spkr in self._getSpeakerList():
if spkr is None:
label = 'None'
else:
label = self._speakerInfoString(spkr)
button = QtGui.QRadioButton(label, widget)
if self.selectedSpeaker == spkr: button.setChecked(True)
buttonGroup.addButton(button)
self.btn2spkr[button] = self.spkrs[spkr][-1]
self.spkr2btn[spkr] = button
color = self.colorMap(spkr)
palette = button.palette()
palette.setColor(QtGui.QPalette.Button, QtGui.QColor(color))
button.setPalette(palette)
button.setAutoFillBackground(True)
layout.addWidget(button)
self.bgpSpkrs = buttonGroup
layout.setMargin(1)
layout.setSpacing(1)
layout.addStretch()
self.setWidget(widget)
开发者ID:hleeldc,项目名称:xtrans,代码行数:34,代码来源:speakerwidgets.py
示例18: test
def test(argv=sys.argv):
app = QApplication(list(argv))
argv = app.arguments()
if len(argv) > 1:
filename = argv[1]
else:
filename = "iris"
import sip
import Orange.distance
w = OWDistanceMap()
w.show()
w.raise_()
data = Orange.data.Table(filename)
dist = Orange.distance.Euclidean(data)
w.set_distances(dist)
w.handleNewSignals()
rval = app.exec_()
w.set_distances(None)
w.saveSettings()
w.onDeleteWidget()
sip.delete(w)
del w
return rval
开发者ID:TimothyXie,项目名称:orange3,代码行数:26,代码来源:owdistancemap.py
示例19: removeWord
def removeWord(self):
item = self.lbox.currentItem()
if item:
word = unicode(item.text())
self.lbox.removeItemWidget(item)
sip.delete(item)
del self.pwl[word]
开发者ID:hleeldc,项目名称:xtrans,代码行数:7,代码来源:spellcheckdialog.py
示例20: clear
def clear(self):
cards = self.cardPanel.children()
for card in cards:
sip.delete(card)
self.cardPanel.setGeometry(0, 0, self.width(), self.height())
self.cardcount = 0
开发者ID:pombredanne,项目名称:software-center,代码行数:7,代码来源:cardwidget.py
注:本文中的sip.delete函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论