本文整理汇总了Python中view.View.reactivateButtons方法的典型用法代码示例。如果您正苦于以下问题:Python View.reactivateButtons方法的具体用法?Python View.reactivateButtons怎么用?Python View.reactivateButtons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view.View
的用法示例。
在下文中一共展示了View.reactivateButtons方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Controller
# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import reactivateButtons [as 别名]
#.........这里部分代码省略.........
if len(self.benches) > 0:
self.log('Signal','Running work','runWork')
self.model.runWork(self.benches)
self.fetchResults()
else:
reactor.callLater(1.0,self.awaitWork)
def fetchResults(self):
if (self.runningWork and not self.runningBench) or not self.resultQueue.empty():
if not self.resultQueue.empty():
# blocking get from queue
passes = self.resultQueue.get()
self.workCallback(passes)
self.log('Signal','Password results found','fetchResults')
reactor.callLater(1.0,self.fetchResults)
def workCallback(self,results):
self.view.showResults(results)
self.log('Signal','Added results','workCallback')
def interval(self):
# self.updateView()
if self.runningBench or self.runningWork:
self.increment()
reactor.callLater(1,self.interval)
else:
self.increment()
self.view.reactivateButtons()
def makeHash(self,hashFunction,key):
hashFunctions = Hash().getPossibleHashFunctions()
if hashFunction in hashFunctions:
hashFunction = hashFunctions[hashFunction]
else:
raise Exception('Hashfunction "%s" not available' % hashFunction)
hash = hashFunction(key)
self.view.showHash(hash)
def updateMaxTimeAsDate(self,hashSpeed):
maxTimeAsDate = self.getMaxTimeAsDate(hashSpeed)
self.view.showMaxTimeAsDate(maxTimeAsDate)
def increment(self):
self.timeRunning += 1
self.updateTime()
if self.runningWork:
self.incrementProgress()
def updateTime(self):
time = self.secondsToTime(self.timeRunning)
self.view.updateTime(time)