From 80e51dcad655e45a45af8d6cd966c82b4f588ebd Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 25 Jul 2014 04:03:28 +0200 Subject: [PATCH] patchutils.py: Remove unused functions min_{source,dest}_size. --- debian/tools/patchutils.py | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/debian/tools/patchutils.py b/debian/tools/patchutils.py index 091cd341..ae1f50de 100644 --- a/debian/tools/patchutils.py +++ b/debian/tools/patchutils.py @@ -24,12 +24,6 @@ class Patch(object): def is_empty(self): raise NotImplementedError("is_empty not implemented.") - def min_source_size(self): - raise NotImplementedError("min_source_size not implemented.") - - def min_dest_size(self): - raise NotImplementedError("min_dest_size not implemented.") - def read_chunks(self): raise NotImplementedError("read_chunks not implemented.") @@ -78,24 +72,6 @@ class FilePatch(Patch): def is_empty(self): return len(self.hunks) == 0 - def min_source_size(self): - """Returns the minimum size of the source file, so that the patch can apply.""" - if self.isbinary: - raise GeneralPatchError("Not possible to calculate minimum source size for binary patches.") - elif len(self.hunks) == 0: - return 0 - last = max(self.hunks, key=lambda x: x[1]+x[2]) - return last[1]+last[2] - - def min_dest_size(self): - """Returns the minimum size of the destination file, so that the patch can apply.""" - if self.isbinary: - raise GeneralPatchError("Not possible to calculate minimum destination size for binary patches.") - elif len(self.hunks) == 0: - return 0 - last = max(self.hunks, key=lambda x: x[3]+x[4]) - return last[3]+last[4] - def read_chunks(self): """Iterates over arbitrary sized chunks of this patch.""" assert self.offset_end >= self.offset_begin @@ -165,20 +141,6 @@ class MemoryPatch(Patch): def is_empty(self): return len(self.hunks) == 0 - def min_source_size(self): - """Returns the minimum size of the source file, so that the patch can apply.""" - if len(self.hunks) == 0: - return 0 - last = max(self.hunks, key=lambda x: x[0]+x[1]) - return last[0]+last[1] - - def min_dest_size(self): - """Returns the minimum size of the destination file, so that the patch can apply.""" - if len(self.hunks) == 0: - return 0 - last = max(self.hunks, key=lambda x: x[2]+x[3]) - return last[2]+last[3] - def read_chunks(self): """Iterates over arbitrary sized chunks of this patch.""" if self.oldname is None or self.newname is None: