[diffoscope] 01/02: diffoscope.comparators: Tidy

Chris Lamb chris at chris-lamb.co.uk
Sat Jan 7 19:34:42 CET 2017


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

lamby pushed a commit to branch master
in repository diffoscope.

commit a8f7ab1d275c0dc5c620fe920625a833ab0abeb4
Author: Chris Lamb <lamby at debian.org>
Date:   Sat Jan 7 18:33:27 2017 +0000

    diffoscope.comparators: Tidy
    
    Gbp-Dch: ignore
---
 diffoscope/comparators/apk.py | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/diffoscope/comparators/apk.py b/diffoscope/comparators/apk.py
index 3d43115..1f212af 100644
--- a/diffoscope/comparators/apk.py
+++ b/diffoscope/comparators/apk.py
@@ -39,15 +39,23 @@ class ApkContainer(Archive):
     @tool_required('apktool')
     def open_archive(self):
         self._members = []
-        self._unpacked = os.path.join(get_temporary_directory().name, self.source.name)
-        logger.debug("extracting %s to %s", self.source.name, self._unpacked)
-        subprocess.check_call(['apktool', 'd', '-k', '-m', '-o', self._unpacked, self.source.path],
-            shell=False, stderr=None, stdout=subprocess.PIPE)
+        self._unpacked = os.path.join(
+            get_temporary_directory().name,
+            self.source.name,
+        )
+
+        logger.debug("Extracting %s to %s", self.source.name, self._unpacked)
+
+        subprocess.check_call((
+            'apktool', 'd', '-k', '-m', '-o', self._unpacked, self.source.path,
+        ), shell=False, stderr=None, stdout=subprocess.PIPE)
+
         for root, _, files in os.walk(self._unpacked):
             for f in files:
                 abspath = os.path.join(root, f)
                 relpath = abspath[len(self._unpacked)+1:]
                 self._members.append(relpath)
+
         return self
 
     def close_archive(self):
@@ -67,4 +75,5 @@ class ApkFile(File):
 
     @staticmethod
     def recognizes(file):
-        return ApkFile.RE_FILE_TYPE.match(file.magic_file_type) and ApkFile.RE_FILE_EXTENSION.search(file.name)
+        return ApkFile.RE_FILE_TYPE.match(file.magic_file_type) and \
+            ApkFile.RE_FILE_EXTENSION.search(file.name)

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


More information about the diffoscope mailing list