# Path: approvaltests/reporters/first_working_reporter.py
# class FirstWorkingReporter(Reporter):
#     """
#     A composite reporter that goes through a list
#     of reporters, running the first one that is
#     working on the current machine.
# 
#     This is mostly an implementation detail of other
#     classes in the library, but it may be useful in scenarios
#     where a team wants to supply a list of custom reporter,
#     and have the first working one of these be used.
# 
#     See also MultiReporter.
#     """
# 
#     def __init__(self, *reporters) -> None:
#         self.reporters = reporters
# 
#     def report(self, received_path: str, approved_path: str) -> bool:
#         for r in self.reporters:
#             try:
#                 success = r.report(received_path, approved_path)
#                 if success:
#                     return True
#             except:
#                 pass
# 
#         return False
# 
#     def __str__(self):
#         reporters = ", ".join(str(s) for s in self.reporters)
#         return f"FirstWorkingReporter({reporters})"
# 
#     __repr__ = __str__
# 
#     def __eq__(self, other) -> bool:
#         return repr(self) == repr(other)
# 
# Path: approvaltests/reporters/generic_diff_reporter.py
# class GenericDiffReporter(Reporter):
#     """
#     A reporter that launches
#     an external diff tool given by config.
#     """
# 
#     @staticmethod
#     def create(diff_tool_path: str) -> "GenericDiffReporter":
#         return GenericDiffReporter(create_config(["custom", diff_tool_path]))
# 
#     def __init__(self, config: GenericDiffReporterConfig) -> None:
#         self.name = config.name
#         self.path = self.expand_program_files(config.path)
#         self.extra_args = config.extra_args
# 
#     def __str__(self) -> str:
#         if self.extra_args:
#             config = {
#                 "name": self.name,
#                 "path": self.path,
#                 "arguments": self.extra_args,
#             }
#         else:
#             config = {"name": self.name, "path": self.path}
# 
#         return to_json(config)
# 
#     @staticmethod
#     def run_command(command_array):
#         subprocess.Popen(command_array)
# 
#     def get_command(self, received: str, approved: str) -> List[str]:
#         return [self.path] + self.extra_args + [received, approved]
# 
#     def report(self, received_path: str, approved_path: str) -> bool:
#         if not self.is_working():
#             return False
#         ensure_file_exists(approved_path)
#         command_array = self.get_command(received_path, approved_path)
#         self.run_command(command_array)
#         return True
# 
#     def is_working(self) -> bool:
#         found = Command(self.path).locate()
#         if not found:
#             return False
#         else:
#             self.path = found
#             return True
# 
#     @staticmethod
#     def expand_program_files(path: str) -> str:
#         if PROGRAM_FILES not in path:
#             return path
# 
#         for candidate in [
#             r"C:/Program Files",
#             r"C:/Program Files (x86)",
#             r"C:/ProgramW6432",
#         ]:
#             possible = path.replace(PROGRAM_FILES, candidate)
#             if Command.executable(possible):
#                 return possible
#         return  path.replace(PROGRAM_FILES, "C:/Program Files")
# 
# class GenericDiffReporterConfig:
#     def __init__(self, name: str, path: str, extra_args: Optional[List[str]] = None):
#         self.name = name
#         self.path = path
#         self.extra_args = extra_args or []
# 
#     def serialize(self):
#         result = [self.name, self.path]
#         if self.extra_args:
#             result.append(self.extra_args)
#         return result


from approvaltests.reporters.first_working_reporter import FirstWorkingReporter
from approvaltests.reporters.generic_diff_reporter import (
    GenericDiffReporter,
    GenericDiffReporterConfig,
)

class ReportWithBeyondCompareMac(GenericDiffReporter):
    def __init__(self):
        super().__init__(
            config=GenericDiffReporterConfig(
                name=self.__class__.__name__, path="/usr/bin/bcompare"
            )
        )


class ReportWithBeyondCompareWindows(GenericDiffReporter):
    def __init__(self):
        super().__init__(
            config=GenericDiffReporterConfig(
                name=self.__class__.__name__,
                path="{ProgramFiles}/Beyond Compare 4/BCompare.exe",
            )
        )

class ReportWithWinMerge(GenericDiffReporter):
    def __init__(self):
        super().__init__(
            config=GenericDiffReporterConfig(
                name=self.__class__.__name__,
                path="{ProgramFiles}/WinMerge/WinMergeU.exe",
            )
        )
class ReportWithPycharm(GenericDiffReporter):
    def __init__(self):
        super().__init__(

# Path: approvaltests/reporters/first_working_reporter.py
# class FirstWorkingReporter(Reporter):
#     """
#     A composite reporter that goes through a list
#     of reporters, running the first one that is
#     working on the current machine.
# 
#     This is mostly an implementation detail of other
#     classes in the library, but it may be useful in scenarios
#     where a team wants to supply a list of custom reporter,
#     and have the first working one of these be used.
# 
#     See also MultiReporter.
#     """
# 
#     def __init__(self, *reporters) -> None:
#         self.reporters = reporters
# 
#     def report(self, received_path: str, approved_path: str) -> bool:
#         for r in self.reporters:
#             try:
#                 success = r.report(received_path, approved_path)
#                 if success:
#                     return True
#             except:
#                 pass
# 
#         return False
# 
#     def __str__(self):
#         reporters = ", ".join(str(s) for s in self.reporters)
#         return f"FirstWorkingReporter({reporters})"
# 
#     __repr__ = __str__
# 
#     def __eq__(self, other) -> bool:
#         return repr(self) == repr(other)
# 
# Path: approvaltests/reporters/generic_diff_reporter.py
# class GenericDiffReporter(Reporter):
#     """
#     A reporter that launches
#     an external diff tool given by config.
#     """
# 
#     @staticmethod
#     def create(diff_tool_path: str) -> "GenericDiffReporter":
#         return GenericDiffReporter(create_config(["custom", diff_tool_path]))
# 
#     def __init__(self, config: GenericDiffReporterConfig) -> None:
#         self.name = config.name
#         self.path = self.expand_program_files(config.path)
#         self.extra_args = config.extra_args
# 
#     def __str__(self) -> str:
#         if self.extra_args:
#             config = {
#                 "name": self.name,
#                 "path": self.path,
#                 "arguments": self.extra_args,
#             }
#         else:
#             config = {"name": self.name, "path": self.path}
# 
#         return to_json(config)
# 
#     @staticmethod
#     def run_command(command_array):
#         subprocess.Popen(command_array)
# 
#     def get_command(self, received: str, approved: str) -> List[str]:
#         return [self.path] + self.extra_args + [received, approved]
# 
#     def report(self, received_path: str, approved_path: str) -> bool:
#         if not self.is_working():
#             return False
#         ensure_file_exists(approved_path)
#         command_array = self.get_command(received_path, approved_path)
#         self.run_command(command_array)
#         return True
# 
#     def is_working(self) -> bool:
#         found = Command(self.path).locate()
#         if not found:
#             return False
#         else:
#             self.path = found
#             return True
# 
#     @staticmethod
#     def expand_program_files(path: str) -> str:
#         if PROGRAM_FILES not in path:
#             return path
# 
#         for candidate in [
#             r"C:/Program Files",
#             r"C:/Program Files (x86)",
#             r"C:/ProgramW6432",
#         ]:
#             possible = path.replace(PROGRAM_FILES, candidate)
#             if Command.executable(possible):
#                 return possible
#         return  path.replace(PROGRAM_FILES, "C:/Program Files")
# 
# class GenericDiffReporterConfig:
#     def __init__(self, name: str, path: str, extra_args: Optional[List[str]] = None):
#         self.name = name
#         self.path = path
#         self.extra_args = extra_args or []
# 
#     def serialize(self):
#         result = [self.name, self.path]
#         if self.extra_args:
#             result.append(self.extra_args)
#         return result


# Path: approvaltests/reporters/report_with_beyond_compare.py
from approvaltests.reporters.first_working_reporter import FirstWorkingReporter
from approvaltests.reporters.generic_diff_reporter import (
    GenericDiffReporter,
    GenericDiffReporterConfig,
)


class ReportWithBeyondCompareMac(GenericDiffReporter):
    def __init__(self):
        super().__init__(
            config=GenericDiffReporterConfig(
                name=self.__class__.__name__, path="/usr/bin/bcompare"
            )
        )


class ReportWithBeyondCompareWindows(GenericDiffReporter):
    def __init__(self):
        super().__init__(
            config=GenericDiffReporterConfig(
                name=self.__class__.__name__,
                path="{ProgramFiles}/Beyond Compare 4/BCompare.exe",
            )
        )

class ReportWithWinMerge(GenericDiffReporter):
    def __init__(self):
        super().__init__(
            config=GenericDiffReporterConfig(
                name=self.__class__.__name__,
                path="{ProgramFiles}/WinMerge/WinMergeU.exe",
            )
        )
class ReportWithPycharm(GenericDiffReporter):
    def __init__(self):
        super().__init__(

            config=GenericDiffReporterConfig(