def _add_tasks_to_taskpaper(<EOL>self,<EOL>pathToTaskpaperDoc,<EOL>taskString<EOL>):
self.log.info('<STR_LIT>')<EOL>exists = os.path.exists(pathToTaskpaperDoc)<EOL>thisData = "<STR_LIT>"<EOL>if exists:<EOL><INDENT>try:<EOL><INDENT>self.log.debug("<STR_LIT>" %<EOL>(pathToTaskpaperDoc,))<EOL>readFile = codecs.open(<EOL>pathToTaskpaperDoc, 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>' % (pathToTaskpaperDoc,)<EOL>self.log.critical(message)<EOL>raise IOError(message)<EOL><DEDENT>readFile.close()<EOL><DEDENT>thisData = taskString + "<STR_LIT:\n>" + thisData<EOL>try:<EOL><INDENT>self.log.debug("<STR_LIT>" %<EOL>(pathToTaskpaperDoc,))<EOL>writeFile = codecs.open(<EOL>pathToTaskpaperDoc, encoding='<STR_LIT:utf-8>', mode='<STR_LIT:w>')<EOL><DEDENT>except IOError as e:<EOL><INDENT>message = '<STR_LIT>' % (pathToTaskpaperDoc,)<EOL>self.log.critical(message)<EOL>raise IOError(message)<EOL><DEDENT>writeFile.write(thisData)<EOL>writeFile.close()<EOL>ws = workspace(<EOL>log=self.log,<EOL>settings=self.settings,<EOL>fileOrWorkspacePath=pathToTaskpaperDoc<EOL>)<EOL>ws.sort()<EOL>self.log.info('<STR_LIT>')<EOL>return None<EOL>
*add the tasks to a taskpaper document*

        **Key Arguments:**
            - ``pathToTaskpaperDoc`` -- the path to the taskpaper document to import the tasks into
            - ``taskString`` -- a string containing tasks in taskpaper format