code: def _add_tasks_to_taskpaper(
          self,
          pathToTaskpaperDoc,
          taskString
      ):
          
          self.log.info('starting the ``_add_tasks_to_taskpaper`` method')
  
          exists = os.path.exists(pathToTaskpaperDoc)
          thisData = ""
          if exists:
              try:
                  self.log.debug("attempting to open the file %s" %
                                 (pathToTaskpaperDoc,))
                  readFile = codecs.open(
                      pathToTaskpaperDoc, encoding='utf-8', mode='r')
                  thisData = readFile.read()
                  readFile.close()
              except IOError, e:
                  message = 'could not open the file %s' % (pathToTaskpaperDoc,)
                  self.log.critical(message)
                  raise IOError(message)
              readFile.close()
  
          thisData = taskString + "\n" + thisData
  
          try:
              self.log.debug("attempting to open the file %s" %
                             (pathToTaskpaperDoc,))
              writeFile = codecs.open(
                  pathToTaskpaperDoc, encoding='utf-8', mode='w')
          except IOError, e:
              message = 'could not open the file %s' % (pathToTaskpaperDoc,)
              self.log.critical(message)
              raise IOError(message)
          writeFile.write(thisData)
          writeFile.close()
  
          ws = workspace(
              log=self.log,
              settings=self.settings,
              fileOrWorkspacePath=pathToTaskpaperDoc
          )
          ws.sort()
  
          self.log.info('completed the ``_add_tasks_to_taskpaper`` method')
          return None
docs: *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