Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 def can_predict(self):
     context = Acquisition.aq_inner(self.context)
     if not context.displayContentsTab():
         return False
     return ISeqRecord.providedBy(context)
Пример #4
0
 def can_predict(self):
     context = Acquisition.aq_inner(self.context)
     if not context.displayContentsTab():
         return False
     return ISeqRecord.providedBy(context)