<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __format_replace_metrics(self, file, metrics):
 """ Formats the given replace metrics and returns the matching rich html text. :param file: File. :type file: unicode :param metrics: Replace metrics to format. :type metrics: unicode :return: Rich text. :rtype: unicode """


        color = "rgb({0}, {1}, {2})"
        span_format = "<span style=\"color: {0};\">{{0}}</span>".format(color.format(self.__default_line_color.red(),
                                                                                     self.__default_line_color.green(),
                                                                                     self.__default_line_color.blue()))
        dir_name, base_name = (os.path.dirname(file), os.path.basename(file))

        return "".join((span_format.format("'"),
                        span_format.format(dir_name),
                        span_format.format(os.path.sep),
                        base_name,
                        span_format.format("' file: '"),
                        foundations.strings.to_string(metrics),
                        span_format.format("' occurence(s) replaced!")))