def newOperation(self, opCode, **kwargs): newOp = operation(opCode, self.selections, previousOp=self.currentOperation, **kwargs) if newOp.isLegal: self.currentOperation = newOp if newOp.opType not in operation.DOESNT_DIRTY: self.activePoints = self.selections.getActivePoints() self.activeParams = self.selections.getActiveParameters() self.app.notifySelection(self.activePoints,self.activeParams) self.app.notifyOperation(newOp) return newOp.isLegal
def __init__(self, vData): self.vData = vData self.app = None self.selections = selectionState(self.vData) self.currentOperation = operation(operation.NO_OP, self.selections, previousOp = None) self.highlightedPoints = set() self.activePoints = self.selections.getActivePoints() self.activeParams = self.selections.getActiveParameters() # will start a local server at http://0.0.0.0 on dataInterface.PORT; all queries will be directed as specified by dataInterface.URLS server = web.application(dataInterface.URLS, globals()) sys.argv.append(str(dataInterface.PORT)) # ugly... serverThread = Thread(target=server.run) serverThread.setDaemon(True) serverThread.start()