Logo Search packages:      
Sourcecode: yagtd version File versions  Download package

def gtd::Task::_schedule_pressure (   self ) [private]
Determine pressure from due date.

Definition at line 201 of file gtd.py.

                                :
        """Determine pressure from due date."""

        now = datetime.datetime.today()  # now

        if self['due']:
            # Compute delta from now and target date (- needed time)
            delta = (self['due'] - now) - self['time']
            #print "delta=", delta

            if delta < datetime.timedelta(0):  # overdue
                P = 6
            elif delta < datetime.timedelta(1):  # 1 day
                P = 5
            elif delta < datetime.timedelta(7):  # 1 week
                P = 4
            elif delta < datetime.timedelta(30):  # 1 month
                P = 3
            elif delta < datetime.timedelta(90):  # 3 months
                P = 2
            else:  # > 3 months
                P = 1
                
        else:  # == urgency
            P = self['urgency']

        #if __debug__: print "Pressure=", P
        return P


Generated by  Doxygen 1.6.0   Back to index