[diffoscope] 03/03: comparators.apk: Reflow long lines.

Chris Lamb chris at chris-lamb.co.uk
Mon Jan 9 12:32:30 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 fe7ae15e1c177866acd478af4cc4a51bd5002017
Author: Chris Lamb <lamby at debian.org>
Date:   Mon Jan 9 11:32:03 2017 +0000

    comparators.apk: Reflow long lines.
    
    Dch-Gbp: Ignore
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/comparators/apk.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/diffoscope/comparators/apk.py b/diffoscope/comparators/apk.py
index 109bdee..7a12837 100644
--- a/diffoscope/comparators/apk.py
+++ b/diffoscope/comparators/apk.py
@@ -55,10 +55,15 @@ class ApkContainer(Archive):
         for root, _, files in os.walk(self._unpacked):
             for f in files:
                 abspath = os.path.join(root, f)
-                # apktool.yml is a file created by apktool and containing metadata information.
-                # Rename it to clarify.
+
+                # apktool.yml is a file created by apktool and containing
+                # metadata information. Rename it to clarify.
                 if os.path.basename(abspath) == 'apktool.yml':
-                    abspath = filter_apk_metadata(abspath, os.path.basename(self.source.name))
+                    abspath = filter_apk_metadata(
+                        abspath,
+                        os.path.basename(self.source.name),
+                    )
+
                 relpath = abspath[len(self._unpacked)+1:]
                 self._members.append(relpath)
 
@@ -92,6 +97,7 @@ class ApkFile(File):
 
 def filter_apk_metadata(filepath, archive_name):
     new_filename = os.path.join(os.path.dirname(filepath), 'APK metadata')
+
     logger.debug("Moving APK metadata from %s to %s", filepath, new_filename)
 
     re_filename = re.compile(
@@ -102,6 +108,8 @@ def filter_apk_metadata(filepath, archive_name):
         with open(new_filename, 'w') as f_out:
             for line in f:
                 if not re_filename.match(line):
-                    f_out.write(line)
+                    w.write(line)
+
     os.remove(filepath)
+
     return new_filename

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


More information about the diffoscope mailing list