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

def yagtd::GTD::do_order (   self,
  nb_attr 
)
Order #nb tasks by context/project/status/reference (and priority):
GTD> order #nb [context|project|status|reference]

Definition at line 804 of file yagtd.py.

                               :
        """Order #nb tasks by context/project/status/reference (and priority):
        GTD> order #nb [context|project|status|reference]"""

        # Parse command line
        nb, attr = self._parse_args(nb_attr)
        
        if not attr or attr not in ['context', 'project', 'status', 'reference']:
            attr = 'context'  # by default order by context

        for c, ts in self.todo.order(attr).items():
            if attr == 'reference':
                tasks = [ t for t in ts ]  # even if completed!
            else:
                tasks = [ t for t in ts if t['complete'] < 100 ] 

            if not tasks: continue  # empty!

            # Section title
            print self._colorize(eval(attr.upper() + '_CHAR') + c.capitalize())

            if nb: tasks = tasks[:nb]  # display only nb tasks
            for t in tasks:
                print self._disp(t)


Generated by  Doxygen 1.6.0   Back to index