Exemple #1
0
 def append_filediff(
         self, gfiles, *, encodings=None, merge_output=None, meta=None):
     assert len(gfiles) in (1, 2, 3)
     doc = FileDiff(len(gfiles))
     self._append_page(doc, "text-x-generic")
     doc.set_files(gfiles, encodings)
     if merge_output is not None:
         doc.set_merge_output_file(merge_output)
     if meta is not None:
         doc.set_meta(meta)
     return doc
Exemple #2
0
 def append_filemerge(self, gfiles, merge_output=None):
     if len(gfiles) != 3:
         raise ValueError(
             _("Need three files to auto-merge, got: %r") %
             [f.get_parse_name() for f in gfiles])
     doc = FileDiff(len(gfiles),
                    comparison_mode=FileComparisonMode.AutoMerge)
     self._append_page(doc)
     doc.set_files(gfiles)
     if merge_output is not None:
         doc.set_merge_output_file(merge_output)
     return doc