Logo Search packages:      
Sourcecode: yagtd version File versions

def yagtd::GTD::_search (   self,
  regexp,
  completed = False,
  quiet = False 
) [private]

Retrieve tasks matching given regexp.
If completed True, also look for completed tasks.

Definition at line 374 of file yagtd.py.

00374                                                            :
        """Retrieve tasks matching given regexp.
        If completed True, also look for completed tasks."""

        # Rk: improved search function that retrieve regexp
        #     over all tasks attributes

        if completed: 
            todos = [ t for t in self.todo.sort() ]  # first sort by priority
        else: 
            todos = [ t for t in self.todo.sort() if t['complete'] < 100 ] 

        # Then, retrieve the pattern (into full desc tasks)
        expr = re.compile(regexp, re.IGNORECASE)
        tasks = [ t for t in todos if expr.search(self._dump_line(t)) ]

        if not quiet:
            for t in tasks:
                print self._disp(t)

        # BB: This tiny line will be damn useful for further use...
        return tasks

    def _searchplus(self, regexp):  # BB


Generated by  Doxygen 1.6.0   Back to index