Beispiel #1
0
    def __repr__(self):
        options = ['interval=%r' % self.interval, 'start_date=%r' % datetime_repr(self.start_date)]
        if self.end_date:
            options.append("end_date=%r" % datetime_repr(self.end_date))
        if self.jitter:
            options.append('jitter=%s' % self.jitter)

        return "<%s (%s, timezone='%s')>" % (
            self.__class__.__name__, ', '.join(options), self.timezone)
Beispiel #2
0
    def __repr__(self):
        options = ['interval=%r' % self.interval, 'start_date=%r' % datetime_repr(self.start_date)]
        if self.end_date:
            options.append("end_date=%r" % datetime_repr(self.end_date))
        if self.jitter:
            options.append('jitter=%s' % self.jitter)

        return "<%s (%s, timezone='%s')>" % (
            self.__class__.__name__, ', '.join(options), self.timezone)
Beispiel #3
0
    def __repr__(self):
        options = ["%s='%s'" % (f.name, f) for f in self.fields if not f.is_default]
        if self.start_date:
            options.append("start_date=%r" % datetime_repr(self.start_date))
        if self.end_date:
            options.append("end_date=%r" % datetime_repr(self.end_date))
        if self.jitter:
            options.append('jitter=%s' % self.jitter)

        return "<%s (%s, timezone='%s')>" % (
            self.__class__.__name__, ', '.join(options), self.timezone)
Beispiel #4
0
    def __repr__(self):
        options = ["%s='%s'" % (f.name, f) for f in self.fields if not f.is_default]
        if self.start_date:
            options.append("start_date=%r" % datetime_repr(self.start_date))
        if self.end_date:
            options.append("end_date=%r" % datetime_repr(self.end_date))
        if self.jitter:
            options.append('jitter=%s' % self.jitter)

        return "<%s (%s, timezone='%s')>" % (
            self.__class__.__name__, ', '.join(options), self.timezone)
Beispiel #5
0
    def __unicode__(self):
        if hasattr(self, 'next_run_time'):
            status = 'next run at: ' + datetime_repr(self.next_run_time) if self.next_run_time else 'paused'
        else:
            status = 'pending'

        return six.u('%s (trigger: %s, %s)') % (self.name, self.trigger, status)
Beispiel #6
0
 def __repr__(self):
     options = [
         "%s='%s'" % (f.name, f) for f in self.fields if not f.is_default
     ]
     if self.start_date:
         options.append("start_date='%s'" % datetime_repr(self.start_date))
     return '<%s (%s)>' % (self.__class__.__name__, ', '.join(options))
Beispiel #7
0
    def __unicode__(self):
        if hasattr(self, 'next_run_time'):
            status = ('next run at: ' + datetime_repr(self.next_run_time)
                      if self.next_run_time else 'paused')
        else:
            status = 'pending'

        return u'%s (trigger: %s, %s)' % (self.name, self.trigger, status)
Beispiel #8
0
    def __unicode__(self):
        if hasattr(self, 'next_run_time'):
            status = 'next run at: ' + datetime_repr(
                self.next_run_time) if self.next_run_time else 'paused'
        else:
            status = 'pending'

        #return six.u('%s (trigger: %s, %s)') % (self.name, self.trigger, status)
        return six.u('%s (trigger: %s, %s)') % (self.name, self.conf.cron_str,
                                                status)
Beispiel #9
0
def get_history_job_info(event):
    job = exscheduler.getjob(event.job_id)
    return {
        "id":
        str(job.id),
        "name":
        str(job.name),
        "kwargs":
        job.kwargs,
        "trigger":
        trigger_str_to_dict(str(job.trigger)),
        "last_run_time":
        datetime_repr(event.scheduled_run_time),
        "status":
        JobStatus.SUCCESS
        if event.code == EVENT_JOB_EXECUTED else JobStatus.FAILED
    }
Beispiel #10
0
 def _getjobinfo(self, job):
     self.jobstatusinitial(job.id)
     return {
         "id":
         str(job.id),
         "name":
         str(job.name),
         "kwargs":
         job.kwargs,
         "trigger":
         trigger_str_to_dict(str(job.trigger)),
         "next_run_time":
         datetime_repr(job.next_run_time)
         if self.__jobstatuslist[str(job.id)] == JobStatus.SCHEDULING or
         self.__jobstatuslist[str(job.id)] == JobStatus.RUNNING else "--",
         "status":
         self.__jobstatuslist[str(job.id)]
     }
Beispiel #11
0
 def __str__(self):
     return 'date[%s]' % datetime_repr(self.run_date)
Beispiel #12
0
def test_datetime_repr(input, expected):
    assert datetime_repr(input) == expected
Beispiel #13
0
 def __repr__(self):
     return "<%s (interval=%r, start_date='%s', timezone='%s')>" % (
         self.__class__.__name__, self.interval,
         datetime_repr(self.start_date), self.timezone)
Beispiel #14
0
 def __str__(self):
     id = 0 if self.id is None else self.id
     return '<Job(%d:%s, trigger: %s, next run at: %s)>' % (id, self.name, self.trigger, datetime_repr(self.next_run_time))
Beispiel #15
0
 def __unicode__(self):
     return six.u('%s (trigger: %s, next run at: %s)') % (
         self.name, self.trigger, datetime_repr(self.next_run_time))
Beispiel #16
0
 def __str__(self):
     return '%s (trigger: %s, next run at: %s)' % (repr_escape(
         self.name), repr_escape(str(
             self.trigger)), datetime_repr(self.next_run_time))
Beispiel #17
0
 def get_jobs_state(self):
     jobs = self.scheduler.get_jobs()
     jobs_state = {}
     for job in jobs:
         jobs_state[job.id] = datetime_repr(job.next_run_time)
     return jobs_state
Beispiel #18
0
 def __str__(self):
     return 'date[%s]' % datetime_repr(self.run_date)
Beispiel #19
0
 def __repr__(self):
     return "<%s (run_date='%s')>" % (self.__class__.__name__,
                                      datetime_repr(self.run_date))
Beispiel #20
0
 def __str__(self):
     return "date[%s]" % datetime_repr(self.run_date)
Beispiel #21
0
 def __repr__(self):
     return "<%s (interval=%r, start_date='%s')>" % (self.__class__.__name__, self.interval,
                                                     datetime_repr(self.start_date))
Beispiel #22
0
 def __str__(self):
     return '%s (trigger: %s, next run at: %s)' % (repr_escape(self.name), repr_escape(str(self.trigger)),
                                                   datetime_repr(self.next_run_time))
Beispiel #23
0
def test_datetime_repr(input, expected):
    assert datetime_repr(input) == expected
Beispiel #24
0
 def __unicode__(self):
     return six.u('%s (trigger: %s, next run at: %s)') % (self.name, self.trigger, datetime_repr(self.next_run_time))
Beispiel #25
0
 def __repr__(self):
     options = ["%s='%s'" % (f.name, str(f)) for f in self.fields if not f.is_default]
     if self.start_date:
         options.append("start_date='%s'" % datetime_repr(self.start_date))
     return '<%s (%s)>' % (self.__class__.__name__, ', '.join(options))
Beispiel #26
0
 def __repr__(self):
     return "<%s (run_date='%s')>" % (self.__class__.__name__, datetime_repr(self.run_date))