本文整理汇总了Python中Orange.OrangeWidgets.OWConcurrent.Task.start方法的典型用法代码示例。如果您正苦于以下问题:Python Task.start方法的具体用法?Python Task.start怎么用?Python Task.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orange.OrangeWidgets.OWConcurrent.Task
的用法示例。
在下文中一共展示了Task.start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Orange.OrangeWidgets.OWConcurrent import Task [as 别名]
# 或者: from Orange.OrangeWidgets.OWConcurrent.Task import start [as 别名]
def __init__(self, parent=None, signalManager=None,
name="Databases update"):
OWWidget.__init__(self, parent, signalManager, name,
wantMainArea=False)
self.searchString = ""
fbox = gui.widgetBox(self.controlArea, "Filter")
self.completer = TokenListCompleter(
self, caseSensitivity=Qt.CaseInsensitive)
self.lineEditFilter = QLineEdit(textChanged=self.SearchUpdate)
self.lineEditFilter.setCompleter(self.completer)
fbox.layout().addWidget(self.lineEditFilter)
box = gui.widgetBox(self.controlArea, "Files")
self.filesView = QTreeWidget(self)
self.filesView.setHeaderLabels(
["", "Data Source", "Update", "Last Updated", "Size"])
self.filesView.setRootIsDecorated(False)
self.filesView.setUniformRowHeights(True)
self.filesView.setSelectionMode(QAbstractItemView.NoSelection)
self.filesView.setSortingEnabled(True)
self.filesView.sortItems(1, Qt.AscendingOrder)
self.filesView.setItemDelegateForColumn(
0, UpdateOptionsItemDelegate(self.filesView))
self.filesView.model().layoutChanged.connect(self.SearchUpdate)
box.layout().addWidget(self.filesView)
box = gui.widgetBox(self.controlArea, orientation="horizontal")
self.updateButton = gui.button(
box, self, "Update all",
callback=self.UpdateAll,
tooltip="Update all updatable files",
)
self.downloadButton = gui.button(
box, self, "Download all",
callback=self.DownloadFiltered,
tooltip="Download all filtered files shown"
)
self.cancelButton = gui.button(
box, self, "Cancel", callback=self.Cancel,
tooltip="Cancel scheduled downloads/updates."
)
self.retryButton = gui.button(
box, self, "Reconnect", callback=self.RetrieveFilesList
)
self.retryButton.hide()
gui.rubber(box)
self.warning(0)
box = gui.widgetBox(self.controlArea, orientation="horizontal")
gui.rubber(box)
self.infoLabel = QLabel()
self.infoLabel.setAlignment(Qt.AlignCenter)
self.controlArea.layout().addWidget(self.infoLabel)
self.infoLabel.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
self.updateItems = []
self.resize(800, 600)
self.progress = ProgressState(self, maximum=3)
self.progress.valueChanged.connect(self._updateProgress)
self.progress.rangeChanged.connect(self._updateProgress)
self.executor = ThreadExecutor(
threadPool=QThreadPool(maxThreadCount=2)
)
task = Task(self, function=self.RetrieveFilesList)
task.exceptionReady.connect(self.HandleError)
task.start()
self._tasks = []
self._haveProgress = False
示例2: __init__
# 需要导入模块: from Orange.OrangeWidgets.OWConcurrent import Task [as 别名]
# 或者: from Orange.OrangeWidgets.OWConcurrent.Task import start [as 别名]
def __init__(self, parent=None, signalManager=None, wantCloseButton=False, showAll=True):
OWWidget.__init__(self, parent, signalManager, wantMainArea=False)
self.searchString = ""
self.showAll = showAll
self.serverFiles = serverfiles.ServerFiles()
box = OWGUI.widgetBox(self.controlArea, orientation="horizontal")
self.lineEditFilter = \
OWGUIEx.lineEditHint(box, self, "searchString", "Filter",
caseSensitive=False,
delimiters=" ",
matchAnywhere=True,
listUpdateCallback=self.SearchUpdate,
callbackOnType=True,
callback=self.SearchUpdate)
box = OWGUI.widgetBox(self.controlArea, "Files")
self.filesView = QTreeWidget(self)
self.filesView.setHeaderLabels(
["", "Data Source", "Update", "Last Updated", "Size"])
self.filesView.setRootIsDecorated(False)
self.filesView.setUniformRowHeights(True)
self.filesView.setSelectionMode(QAbstractItemView.NoSelection)
self.filesView.setSortingEnabled(True)
self.filesView.sortItems(1, Qt.AscendingOrder)
self.filesView.setItemDelegateForColumn(
0, UpdateOptionsItemDelegate(self.filesView))
QObject.connect(self.filesView.model(),
SIGNAL("layoutChanged()"),
self.SearchUpdate)
box.layout().addWidget(self.filesView)
box = OWGUI.widgetBox(self.controlArea, orientation="horizontal")
self.updateButton = OWGUI.button(box, self, "Update all",
callback=self.UpdateAll,
tooltip="Update all updatable files",
)
self.downloadButton = OWGUI.button(box, self, "Download all",
callback=self.DownloadFiltered,
tooltip="Download all filtered files shown")
self.cancelButton = OWGUI.button(box, self, "Cancel", callback=self.Cancel,
tooltip="Cancel scheduled downloads/updates.")
OWGUI.rubber(box)
self.retryButton = OWGUI.button(box, self, "Retry",
callback=self.RetrieveFilesList)
self.retryButton.hide()
box = OWGUI.widgetBox(self.controlArea, orientation="horizontal")
OWGUI.rubber(box)
if wantCloseButton:
OWGUI.button(box, self, "Close",
callback=self.accept,
tooltip="Close")
self.infoLabel = QLabel()
self.infoLabel.setAlignment(Qt.AlignCenter)
self.controlArea.layout().addWidget(self.infoLabel)
self.infoLabel.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
self.updateItems = []
self.resize(800, 600)
self.progress = ProgressState(self, maximum=3)
self.progress.valueChanged.connect(self._updateProgress)
self.progress.rangeChanged.connect(self._updateProgress)
self.executor = ThreadExecutor(
threadPool=QThreadPool(maxThreadCount=2)
)
task = Task(self, function=self.RetrieveFilesList)
task.exceptionReady.connect(self.HandleError)
task.start()
self._tasks = []
self._haveProgress = False