예제 #1
0
 def __init__(self, **data):
     """
     constructor of Superclass
     """
     Persistent.__init__(self)
     ISuperclass['objectID'].readonly = False
     self.objectID = generateOid(self)
     self.ikName = self.objectID
     for (name, value) in data.items():
         if name in ISuperclass.names():
             setattr(self, name, value)
     ISuperclass['objectID'].readonly = True
     self.ikAuthor = u""
     self.dbgLevel = NOTSET
     self.history = RingBuffer(20)
     self.inpEQueue = Queue()
     self.outEQueue = Queue()
     self.outEReceiver = None
     self.workflows = {}
     self.wf_worklist = []
     interaction = queryInteraction()
     if interaction is not None:
         for participation in interaction.participations:
             #principalid = participation.principal.id
             principal_title = participation.principal.title
             self.ikAuthor += unicode(principal_title)
     self.myFactory = str(self.__class__).split("'")[1]
     self.ikRevision = __version__
예제 #2
0
 def makeNewObjQueue(self, senderObj):
     """ will create a new input and output queue for this sender object """
     objId = senderObj.getObjectId()
     if not self.inpEQueues.has_key(objId):
         self.inpEQueues[objId] = Queue()
     if not self.outEQueues.has_key(objId):
         self.outEQueues[objId] = Queue()
     return True
예제 #3
0
    def __call__(self):
        self.install_upgrade_profile()
        annotations = IAnnotations(self.portal)

        jobs = annotations.get('publisher-queue', ())
        if hasattr(jobs, 'values'):
            jobs = jobs.values()

        queue = annotations['publisher-queue'] = Queue()
        map(queue.put, ProgressLogger('Migrate jobs to new queue storage', jobs))
예제 #4
0
    def __init__(self):
        # logging.getLogger('scheduler') = logging.getLogger('scheduler')
        # logging.getLogger('scheduler').warning('Creating incomingQueue and runningList..')
        self._waitingQueue = PersistentWaitingQueue()
        self._runningList = []

        # Failed tasks (there is an object still in the DB)
        self._failedIndex = IOIndex(IIndexableByArbitraryDateTime)

        # Finished tasks (no object data, just metadata)
        self._finishedIndex = IOIndex(IIndexableByArbitraryDateTime)

        # Stores all tasks
        self._taskIdx = IOBTree()
        self._taskCounter = Length(0)

        # Is the scheduler running
        self._schedulerStatus = False

        # Temporary area where all the tasks stay before being
        # added to the waiting list
        self._taskSpool = Queue()