Logo Search packages:      
Sourcecode: yagtd version File versions

def yagtd::GTD::do_archive (   self,
  donetxt 
)

Archive completed tasks:
GTD> archive [path/to/done.txt]

Definition at line 961 of file yagtd.py.

00961                                  :
        """Archive completed tasks:
        GTD> archive [path/to/done.txt]"""

        if donetxt == "": donetxt = DONE_TXT

        # List done/close tasks
        done_lst = [ t for t in self.todo if t['complete'] >= 100 ]

        try:
            f = open(donetxt, 'w')
            try:
                for t in done_lst:
                    f.write(self._dump_line(t) + "\n")
                # If all okey, remove done/close tasks from current list
                self.todo = [ t for t in self.todo if t['complete'] < 100 ]
            finally:
                f.close()
                print "%d tasks archived as '%s'" % (len(done_lst), donetxt)
        except IOError, err:
            print err  # and continue

    def do_print(self, rest):


Generated by  Doxygen 1.6.0   Back to index