Logo Search packages:      
Sourcecode: yagtd version File versions

def yagtd::GTD::do_close (   self,
  id 
)

Close the given task:
GTD> close #id

Definition at line 466 of file yagtd.py.

00466                           :
        """Close the given task:
        GTD> close #id"""

        # Parse command line
        idx = self._parse_args(id)[0]

        if idx:
            # First, we need to find the task
            task = self.todo.find('id', idx)
            if task:
                if task['recurrence']:
                    if not task['due']:
                        task['due'] = datetime.datetime.now()
                    task['start'] = task['due']  # reinit start date
                    task['due'] = task['start'] + task['recurrence']
                    print "Task #%d (%s) rescheduled (%s)." % (idx, task['title'], task['due'])
                else:
                    task['end'] = datetime.datetime.now()
                    task['complete'] = 100
                    print "Task #%d (%s) completed." % (idx, task['title'])

    do_done = do_close


Generated by  Doxygen 1.6.0   Back to index