[Git][reproducible-builds/diffoscope][master] 5 commits: Tidy some imports.

Chris Lamb gitlab at salsa.debian.org
Sat May 16 14:52:57 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
1ed02bc5 by Chris Lamb at 2020-05-16T15:25:48+01:00
Tidy some imports.

Gbp-Dch: ignore

- - - - -
13dff092 by Chris Lamb at 2020-05-16T15:28:03+01:00
Comment the HTMLPrintContext class.

- - - - -
e2a21f18 by Chris Lamb at 2020-05-16T15:30:02+01:00
Clarify the message when we cannot find the "debian" Python module.

- - - - -
8b33709a by Chris Lamb at 2020-05-16T15:31:10+01:00
Add descriptions for the 'fallback' Debian module file types.

- - - - -
6db6cae8 by Chris Lamb at 2020-05-16T15:33:54+01:00
Abstract out the duplicated parts of the diffoscope/comparators/debian_fallback.py class.

- - - - -


2 changed files:

- diffoscope/comparators/debian_fallback.py
- diffoscope/presenters/html/html.py


Changes:

=====================================
diffoscope/comparators/debian_fallback.py
=====================================
@@ -3,7 +3,7 @@
 # diffoscope: in-depth comparison of files, archives, and directories
 #
 # Copyright © 2015 Jérémy Bobbio <lunar at debian.org>
-# Copyright © 2016-2019 Chris Lamb <lamby at debian.org>
+# Copyright © 2016-2020 Chris Lamb <lamby at debian.org>
 #
 # diffoscope is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,40 +21,27 @@
 from .text import TextFile
 
 
-class DotChangesFile(TextFile):
-    FILE_EXTENSION_SUFFIX = '.changes'
-
+class AbstractDebianFallbackFile(TextFile):
     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.'
+            'Unable to find the "debian" Python module. Falling back to text comparison.'
         )
         return difference
 
 
-class DotDscFile(TextFile):
-    FILE_EXTENSION_SUFFIX = '.dsc'
+class DotChangesFile(AbstractDebianFallbackFile):
+    DESCRIPTION = "Debian .changes files"
+    FILE_EXTENSION_SUFFIX = '.changes'
 
-    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.'
-        )
-        return difference
 
+class DotDscFile(AbstractDebianFallbackFile):
+    DESCRIPTION = "Debian source packages (.dsc)"
+    FILE_EXTENSION_SUFFIX = '.dsc'
 
-class DotBuildinfoFile(TextFile):
-    FILE_EXTENSION_SUFFIX = '.buildinfo'
 
-    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.'
-        )
-        return difference
+class DotBuildinfoFile(AbstractDebianFallbackFile):
+    DESCRIPTION = "Debian .buildinfo files"
+    FILE_EXTENSION_SUFFIX = '.buildinfo'


=====================================
diffoscope/presenters/html/html.py
=====================================
@@ -44,7 +44,8 @@ import os
 import pprint
 import re
 import sys
-from unicodedata import normalize
+import unicodedata
+
 from urllib.parse import urlparse
 
 from diffoscope import VERSION
@@ -169,7 +170,7 @@ def convert(s, ponct=0, tag=''):
             i = 0
             t.write('\u200b')
 
-    return normalize('NFC', t.getvalue())
+    return unicodedata.normalize('NFC', t.getvalue())
 
 
 def output_visual(ctx, visual, path, indentstr, indentnum):
@@ -385,6 +386,10 @@ class HTMLPrintContext(
         "target single_page jquery_url css_url our_css_url icon_url used_anchors",
     )
 ):
+    """
+    Hold states scoped to a single run of the HTMl generation.
+    """
+
     @property
     def directory(self):
         return None if self.single_page else self.target



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/63cf7e1d50cacc046fffebb826d44d1770a47ecf...6db6cae8fb22ef7080dd949148838459d389ef02

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/63cf7e1d50cacc046fffebb826d44d1770a47ecf...6db6cae8fb22ef7080dd949148838459d389ef02
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200516/6a66bb23/attachment.htm>


More information about the rb-commits mailing list