docs: def is_valid_export_dir(self):
          """
          export_dir={export_dir} must refer to a directory,
          and the user must have the permission to write on it.
          """
          if self.export_dir and not os.path.isabs(self.export_dir):
              self.export_dir = os.path.normpath(
                  os.path.join(self.input_dir, self.export_dir))
          if not self.export_dir:
              self.export_dir = os.path.expanduser('~')  # home directory
              logging.warning('export_dir not specified. Using export_dir=%s'
                              % self.export_dir)
              return True
          elif not os.path.exists(self.export_dir):
              try:
                  os.makedirs(self.export_dir)
              except PermissionError:
                  return False
              return True
          return os.path.isdir(self.export_dir) and os.access(
              self.export_dir, os.W_OK)