#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 1998-2026 Stephane Galland <galland@arakhne.org>
#
# This program is free library; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; see the file COPYING.  If not,
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite
# 330, Boston, MA 02111-1307, USA.

from abc import ABC, abstractmethod
from typing import Any


class BibliographyErrorParser(ABC):
	"""
	Abstract implementation for parsers of errors generated by bibliography tools.
	"""

	@abstractmethod
	def parse_log(self, default_filename : str, log : str) -> dict[str,Any] | None:
		"""
		Parse the Biber log and replies the discovered error.
		:param default_filename: The name of the Biber file to parse.
		:type default_filename: str
		:param log: Content of the log.
		:type log: str
		:return: the error from Biber.
		:rtype: str | None
		"""
		raise NotImplementedError()

