def run(self, obj, context=None, store=False, argv=([], {})): """ """ assert type(argv[0]) == list assert type(argv[1]) == dict if not hasattr(self, '_v_predictor'): self._load_predictor() if ISeqRecord.providedBy(obj): newseqr = self._v_predictor.run(obj.getSeqRecord(), *argv[0], **argv[1]) if store: #TODO: need locking? obj.features = newseqr.features #TODO: raise event return obj else: return SeqRecord(newseqr.id, title=newseqr.name, seqrecord=newseqr) else: newseqr = self._v_predictor.run(obj, *argv[0], **argv[1]) if store: obj.features = newseqr.features return obj else: return newseqr
def run(self, obj, context=None, store=False, argv=([], {})): """ """ assert type(argv[0]) == list assert type(argv[1]) == dict if not hasattr(self, "_v_predictor"): self._load_predictor() if ISeqRecord.providedBy(obj): newseqr = self._v_predictor.run(obj.getSeqRecord(), *argv[0], **argv[1]) if store: # TODO: need locking? obj.features = newseqr.features # TODO: raise event return obj else: return SeqRecord(newseqr.id, title=newseqr.name, seqrecord=newseqr) else: newseqr = self._v_predictor.run(obj, *argv[0], **argv[1]) if store: obj.features = newseqr.features return obj else: return newseqr
def can_predict(self): context = Acquisition.aq_inner(self.context) if not context.displayContentsTab(): return False return ISeqRecord.providedBy(context)