コード例 #1
0
ファイル: dvdCreation.py プロジェクト: davidmorrison/indico
    def create(self):
        # Create a wrapper for the RH
        rhw = RHWrapper(self._rh)
        # Instantiate a dvd creator
        if self._wf is None:
            dvdCreator = ConferenceOfflineCreator(rhw, self._conf)
        else:
            dvdCreator = MeetingOfflineCreator(rhw, self._conf)
        dvdCreator.setId("OffLineWebsiteCreator")
        
        # Create a task for the DVD Creator
        dvdTask = task()
        dvdTask.addObj(dvdCreator)

        # Add the track to the track list
        htl = HelperTaskList.getTaskListInstance()
        htl.addTask(dvdTask)
コード例 #2
0
ファイル: dvdCreation.py プロジェクト: sylvestre/indico
    def create(self):
        # Create a wrapper for the RH
        rhw = RHWrapper(self._rh)
        # Instantiate a dvd creator
        if self._wf is None:
            dvdCreator = ConferenceOfflineCreator(rhw, self._conf)
        else:
            dvdCreator = MeetingOfflineCreator(rhw, self._conf)
        dvdCreator.setId("OffLineWebsiteCreator")

        # Create a task for the DVD Creator
        dvdTask = task()
        dvdTask.addObj(dvdCreator)

        # Add the task to the task list
        htl = HelperTaskList.getTaskListInstance()
        htl.addTask(dvdTask)
コード例 #3
0
 def _addTask(self, email):
     """Creating a task in order to send reminder emails periodically.
        It's mandatory to implement this method for the specific pending queues"""
     # ------ Creating a task in order to send reminder emails periodically ------
     if not self._hasTask(email):
         # Create the object which send the email
         pedingReminder=self._reminder(email)
         pedingReminder.setId("ReminderPending%s-%s"%(self._id,email))
         # Create the task
         t=task()
         t.addObj(pedingReminder) 
         t.setInterval(timedelta(7)) # Remind each 7 days
         nw=nowutc()
         t.setLastDate(nw) # start in 7 days cos the first email was already sent
         t.setEndDate(nw+timedelta(15)) # keep trying during 15 days
         self._tasksIdx.indexTask(email, t)
         # Add the track to the track list
         htl = HelperTaskList.getTaskListInstance()
         htl.addTask(t)
コード例 #4
0
ファイル: taskDaemon.py プロジェクト: davidmorrison/indico
    print "\nTrying to connect with the database...\nIf you don't see any following message, please make sure that you have already started the database because you might have a connection problem with it.\n"
    DBMgr.getInstance().startRequest()
    print "Database connection established."
    # ------------------------ STATISTICS ------------------------
    tl = HelperTaskList.getTaskListInstance()
    catRoot = CategoryManager().getRoot()
    try:
        if catRoot.statsUpdater != None:
            tl.removeTask(catRoot.statsUpdater)
            catRoot.statsUpdater = None
    except:
        catRoot.statsUpdater = None
    su = StatisticsUpdater(catRoot)
    su.setId("StatisticsUpdater")
    ta = task()
    d = nowutc() + timedelta(days=1)
    ta.setStartDate(datetime(d.year, d.month, d.day, 0, 0, tzinfo=timezone('UTC')))
    ta.setInterval(timedelta(days=1))
    ta.addObj(su)
    tl.addTask(ta)
    catRoot.statsUpdater = ta
    print "Added statistics updater task to the tasks list."
    # --------------------- END STATISTICS ---------------------
    DBMgr.getInstance().endRequest()
    print ""

def fileExists(f):
     try:
        fi = open(f,'a')
        fi.close()
コード例 #5
0
ファイル: taskDaemon.py プロジェクト: lukasnellen/indico
    print "\nTrying to connect with the database...\nIf you don't see any following message, please make sure that you have already started the database because you might have a connection problem with it.\n"
    DBMgr.getInstance().startRequest()
    print "Database connection established."
    # ------------------------ STATISTICS ------------------------
    tl = HelperTaskList.getTaskListInstance()
    catRoot = CategoryManager().getRoot()
    try:
        if catRoot.statsUpdater != None:
            tl.removeTask(catRoot.statsUpdater)
            catRoot.statsUpdater = None
    except:
        catRoot.statsUpdater = None
    su = StatisticsUpdater(catRoot)
    su.setId("StatisticsUpdater")
    ta = task()
    d = nowutc() + timedelta(days=1)
    ta.setStartDate(
        datetime(d.year, d.month, d.day, 0, 0, tzinfo=timezone('UTC')))
    ta.setInterval(timedelta(days=1))
    ta.addObj(su)
    tl.addTask(ta)
    catRoot.statsUpdater = ta
    print "Added statistics updater task to the tasks list."
    # --------------------- END STATISTICS ---------------------
    DBMgr.getInstance().endRequest()
    print ""


def fileExists(f):
    try: