Skip to content
Snippets Groups Projects
Commit 1e8d07af authored by Ximin Luo's avatar Ximin Luo
Browse files

Allow the "source" param to overridden compare() methods to be given as a positional argument

parent 5b833952
No related branches found
No related tags found
No related merge requests found
......@@ -136,13 +136,13 @@ class ApkContainer(Archive):
diff_manifests.add_comment(comment)
return diff_manifests
def compare(self, other, **kwargs):
def compare(self, other, *args, **kwargs):
differences = []
try:
differences.append(self.compare_manifests(other))
except AttributeError: # no apk-specific methods, e.g. MissingArchive
pass
differences.extend(super().compare(other, **kwargs))
differences.extend(super().compare(other, *args, **kwargs))
return differences
class ApkFile(File):
......
......@@ -178,8 +178,8 @@ class DotChangesFile(DebControlFile):
return True
def compare(self, other, **kwargs):
differences = super().compare(other, **kwargs)
def compare(self, other, *args, **kwargs):
differences = super().compare(other, *args, **kwargs)
if differences is None:
return None
......
......@@ -25,8 +25,8 @@ from .text import TextFile
class DotChangesFile(TextFile):
RE_FILE_EXTENSION = re.compile(r'\.changes$')
def compare(self, other, **kwargs):
difference = super().compare(other, **kwargs)
def compare(self, other, *args, **kwargs):
difference = super().compare(other, *args, **kwargs)
if not difference:
return None
difference.add_comment('Unable to find Python debian module. Falling back to text comparison.')
......@@ -35,8 +35,8 @@ class DotChangesFile(TextFile):
class DotDscFile(TextFile):
RE_FILE_EXTENSION = re.compile(r'\.dsc$')
def compare(self, other, **kwargs):
difference = super().compare(other, **kwargs)
def compare(self, other, *args, **kwargs):
difference = super().compare(other, *args, **kwargs)
if not difference:
return None
difference.add_comment('Unable to find Python debian module. Falling back to text comparison.')
......@@ -45,8 +45,8 @@ class DotDscFile(TextFile):
class DotBuildinfoFile(TextFile):
RE_FILE_EXTENSION = re.compile(r'\.buildinfo$')
def compare(self, other, **kwargs):
difference = super().compare(other, **kwargs)
def compare(self, other, *args, **kwargs):
difference = super().compare(other, *args, **kwargs)
if not difference:
return None
difference.add_comment('Unable to find Python debian module. Falling back to text comparison.')
......
......@@ -39,8 +39,8 @@ class Pstotext(Command):
class PsFile(TextFile):
RE_FILE_TYPE = re.compile(r'^PostScript document\b')
def compare(self, other, **kwargs):
differences = super().compare(other, **kwargs)
def compare(self, other, *args, **kwargs):
differences = super().compare(other, *args, **kwargs)
details = None
try:
details = Difference.from_command(Pstotext, self.path, other.path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment