def _archive_tp_file_done_tasks(<EOL>self,<EOL>taskpaperPath):
self.log.info('<STR_LIT>')<EOL>self.log.info("<STR_LIT>" % locals())<EOL>taskLog = {}<EOL>mdArchiveFile = taskpaperPath.replace("<STR_LIT>", "<STR_LIT>")<EOL>exists = os.path.exists(mdArchiveFile)<EOL>if exists:<EOL><INDENT>pathToReadFile = mdArchiveFile<EOL>try:<EOL><INDENT>self.log.debug("<STR_LIT>" %<EOL>(pathToReadFile,))<EOL>readFile = codecs.open(<EOL>pathToReadFile, encoding='<STR_LIT:utf-8>', mode='<STR_LIT:r>')<EOL>thisData = readFile.read()<EOL>readFile.close()<EOL><DEDENT>except IOError as e:<EOL><INDENT>message = '<STR_LIT>' % (pathToReadFile,)<EOL>self.log.critical(message)<EOL>raise IOError(message)<EOL><DEDENT>readFile.close()<EOL>table = False<EOL>for l in thisData.split("<STR_LIT:\n>"):<EOL><INDENT>l = l.encode("<STR_LIT:utf-8>")<EOL>if "<STR_LIT>" in l:<EOL><INDENT>table = True<EOL>continue<EOL><DEDENT>if table == True and len(l) and l[<NUM_LIT:0>] == "<STR_LIT:|>":<EOL><INDENT>dictt = collections.OrderedDict(sorted({}.items()))<EOL>columns = l.split("<STR_LIT:|>")<EOL>dictt["<STR_LIT>"] = columns[<NUM_LIT:1>].strip().decode("<STR_LIT:utf-8>")<EOL>dictt["<STR_LIT>"] = columns[<NUM_LIT:2>].strip().decode("<STR_LIT:utf-8>")<EOL>dictt["<STR_LIT>"] = columns[<NUM_LIT:3>].strip().decode("<STR_LIT:utf-8>")<EOL>taskLog[dictt["<STR_LIT>"] + dictt["<STR_LIT>"] +<EOL>dictt["<STR_LIT>"]] = dictt<EOL><DEDENT><DEDENT><DEDENT>doc = document(taskpaperPath)<EOL>aProject = doc.get_project("<STR_LIT>")<EOL>if not aProject:<EOL><INDENT>return<EOL><DEDENT>doneTasks = aProject.tagged_tasks("<STR_LIT>")<EOL>for task in doneTasks:<EOL><INDENT>dateCompleted = "<STR_LIT>"<EOL>project = "<STR_LIT>"<EOL>for t in task.tags:<EOL><INDENT>if "<STR_LIT>" in t:<EOL><INDENT>dateCompleted = t.replace("<STR_LIT>", "<STR_LIT>").replace(<EOL>"<STR_LIT:(>", "<STR_LIT>").replace("<STR_LIT:)>", "<STR_LIT>")<EOL><DEDENT>if "<STR_LIT>" in t:<EOL><INDENT>project = t.replace("<STR_LIT>", "<STR_LIT>").replace(<EOL>"<STR_LIT:(>", "<STR_LIT>").replace("<STR_LIT:)>", "<STR_LIT>")<EOL><DEDENT><DEDENT>dictt = collections.OrderedDict(sorted({}.items()))<EOL>notes = "<STR_LIT>"<EOL>if task.notes:<EOL><INDENT>for n in task.notes:<EOL><INDENT>if len(notes) and notes[-<NUM_LIT:2>:] != "<STR_LIT>":<EOL><INDENT>if notes[-<NUM_LIT:1>] == "<STR_LIT:.>":<EOL><INDENT>notes += "<STR_LIT:U+0020>"<EOL><DEDENT>else:<EOL><INDENT>notes += "<STR_LIT>"<EOL><DEDENT><DEDENT>notes += n.title<EOL><DEDENT><DEDENT>if len(notes):<EOL><INDENT>notes = "<STR_LIT>" +"<STR_LIT>".join(textwrap.wrap(<EOL>notes, <NUM_LIT>, break_long_words=True))<EOL><DEDENT>dictt["<STR_LIT>"] = "<STR_LIT>".join(textwrap.wrap(task.title[<EOL><NUM_LIT:2>:], <NUM_LIT>, break_long_words=True)) + notes<EOL>dictt["<STR_LIT>"] = dictt["<STR_LIT>"].encode("<STR_LIT:utf-8>")<EOL>dictt["<STR_LIT>"] = dateCompleted<EOL>dictt["<STR_LIT>"] = project<EOL>dictt["<STR_LIT>"] = dictt["<STR_LIT>"].decode("<STR_LIT:utf-8>")<EOL>dictt["<STR_LIT>"] = dictt["<STR_LIT>"].decode("<STR_LIT:utf-8>")<EOL>dictt["<STR_LIT>"] = dictt["<STR_LIT>"].decode("<STR_LIT:utf-8>")<EOL>taskLog[dictt["<STR_LIT>"] + dictt["<STR_LIT>"] +<EOL>dictt["<STR_LIT>"]] = dictt<EOL><DEDENT>taskLog = list(taskLog.values())<EOL>taskLog = sorted(taskLog, key=itemgetter('<STR_LIT>'), reverse=True)<EOL>taskLog = sorted(taskLog, key=itemgetter('<STR_LIT>'), reverse=True)<EOL>taskLog = sorted(taskLog, key=itemgetter('<STR_LIT>'), reverse=True)<EOL>dataSet = list_of_dictionaries(<EOL>log=self.log,<EOL>listOfDictionaries=taskLog<EOL>)<EOL>markdownData = dataSet.markdown(filepath=None)<EOL>try:<EOL><INDENT>self.log.debug("<STR_LIT>" % (mdArchiveFile,))<EOL>writeFile = codecs.open(mdArchiveFile, encoding='<STR_LIT:utf-8>', mode='<STR_LIT:w>')<EOL><DEDENT>except IOError as e:<EOL><INDENT>message = '<STR_LIT>' % (mdArchiveFile,)<EOL>self.log.critical(message)<EOL>raise IOError(message)<EOL><DEDENT>writeFile.write(markdownData.decode("<STR_LIT:utf-8>"))<EOL>writeFile.close()<EOL>aProject.delete()<EOL>doc.save()<EOL>self.log.info('<STR_LIT>')<EOL>return None<EOL>
* archive tp file done tasks*

        **Key Arguments:**
            - ``taskpaperPath`` -- path to a taskpaper file

        **Return:**
            - None