# Path: mfr/core/metrics.py
# class MetricsRecord(MetricsBase):
#     """An extension to MetricsBase that carries a category and list of submetrics.  When
#     serialized, will include the serialized child metrics
#     """
# 
#     def __init__(self, category):
#         super().__init__()
#         self.category = category
#         self.subrecords = []
# 
#     @property
#     def key(self):
#         """ID string for this record: '{category}'"""
#         return self.category
# 
#     def serialize(self):
#         """Returns its metrics with the metrics for each of the subrecords included under their key.
#         """
#         metrics = super().serialize()
#         for subrecord in self.subrecords:
#             metrics[subrecord.key] = subrecord.serialize()
# 
#         return metrics
# 
#     def new_subrecord(self, name):
#         """Create a new MetricsSubRecord object with our category and save it to the subrecords
#         list."""
#         subrecord = MetricsSubRecord(self.category, name)
#         self.subrecords.append(subrecord)
#         return subrecord


import abc
from mfr.core.metrics import MetricsRecord



class BaseExporter(metaclass=abc.ABCMeta):

    def __init__(self, ext, source_file_path, output_file_path, format, metadata):

        """Initialize the base exporter.

        :param ext: the name of the extension to be exported
        :param source_file_path: the path of the input file
        :param output_file_path: the path of the output file
        :param format: the format of the exported file (e.g. 1200*1200.jpg)
        """

        self.ext = ext
        self.source_file_path = source_file_path
        self.output_file_path = output_file_path
        self.format = format
        self.metadata = metadata

# Path: mfr/core/metrics.py
# class MetricsRecord(MetricsBase):
#     """An extension to MetricsBase that carries a category and list of submetrics.  When
#     serialized, will include the serialized child metrics
#     """
# 
#     def __init__(self, category):
#         super().__init__()
#         self.category = category
#         self.subrecords = []
# 
#     @property
#     def key(self):
#         """ID string for this record: '{category}'"""
#         return self.category
# 
#     def serialize(self):
#         """Returns its metrics with the metrics for each of the subrecords included under their key.
#         """
#         metrics = super().serialize()
#         for subrecord in self.subrecords:
#             metrics[subrecord.key] = subrecord.serialize()
# 
#         return metrics
# 
#     def new_subrecord(self, name):
#         """Create a new MetricsSubRecord object with our category and save it to the subrecords
#         list."""
#         subrecord = MetricsSubRecord(self.category, name)
#         self.subrecords.append(subrecord)
#         return subrecord


# Path: mfr/core/extension.py
import abc
from mfr.core.metrics import MetricsRecord




class BaseExporter(metaclass=abc.ABCMeta):

    def __init__(self, ext, source_file_path, output_file_path, format, metadata):

        """Initialize the base exporter.

        :param ext: the name of the extension to be exported
        :param source_file_path: the path of the input file
        :param output_file_path: the path of the output file
        :param format: the format of the exported file (e.g. 1200*1200.jpg)
        """

        self.ext = ext
        self.source_file_path = source_file_path
        self.output_file_path = output_file_path
        self.format = format
        self.metadata = metadata

        self.exporter_metrics = MetricsRecord('exporter')