[diffoscope] 02/02: Change DexContainer class to use OneMemberContainer

Maria Glukhova siamezzze-guest at moszumanska.debian.org
Thu Feb 16 22:45:01 CET 2017


This is an automated email from the git hooks/post-receive script.

siamezzze-guest pushed a commit to branch siamezzze/containers
in repository diffoscope.

commit 2c82cd2b027f0811113a768b7b5821d89a239c94
Author: Maria Glukhova <siamezzze at gmail.com>
Date:   Thu Feb 16 23:32:30 2017 +0200

    Change DexContainer class to use OneMemberContainer
---
 diffoscope/comparators/dex.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/diffoscope/comparators/dex.py b/diffoscope/comparators/dex.py
index 3232c06..ca5ec35 100644
--- a/diffoscope/comparators/dex.py
+++ b/diffoscope/comparators/dex.py
@@ -27,12 +27,13 @@ from diffoscope.tools import tool_required
 
 from .utils.file import File
 from .utils.archive import Archive
+from .utils.container import OneMemberContainer
 from .utils.filenames import get_compressed_content_name
 
 logger = logging.getLogger(__name__)
 
 
-class DexContainer(Archive):
+class DexContainer(Archive, OneMemberContainer):
     @property
     def path(self):
         return self._path
@@ -44,7 +45,7 @@ class DexContainer(Archive):
         pass
 
     def get_members(self):
-        return collections.OrderedDict({'dex-content': self.get_member(self.get_member_names()[0])})
+        return collections.OrderedDict({'dex-content': self.get_the_only_member()})
 
     def get_member_names(self):
         return [get_compressed_content_name(self.source.path, '.dex') + '.jar']

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list