code: def create_filename_parser(self, base_dir):
          
          # just in case a writer needs more complex file patterns
          # Set a way to create filenames if we were given a pattern
          if base_dir and self.file_pattern:
              file_pattern = os.path.join(base_dir, self.file_pattern)
          else:
              file_pattern = self.file_pattern
          return parser.Parser(file_pattern) if file_pattern else None
docs: Create a :class:`trollsift.parser.Parser` object for later use.