[diffoscope] 03/05: diffoscope/comparators: use relative package imports.
Chris Lamb
chris at chris-lamb.co.uk
Tue Dec 27 18:16:15 CET 2016
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository diffoscope.
commit b3a20511dcf1040484546e55f11cb419246ba005
Author: Chris Lamb <lamby at debian.org>
Date: Tue Dec 27 14:17:03 2016 +0000
diffoscope/comparators: use relative package imports.
Signed-off-by: Chris Lamb <lamby at debian.org>
---
diffoscope/comparators/apk.py | 5 +++--
diffoscope/comparators/ar.py | 7 ++++---
diffoscope/comparators/binary.py | 4 ++--
diffoscope/comparators/bzip2.py | 5 +++--
diffoscope/comparators/cbfs.py | 5 +++--
diffoscope/comparators/cpio.py | 7 ++++---
diffoscope/comparators/deb.py | 20 ++++++++++----------
diffoscope/comparators/debian.py | 5 +++--
diffoscope/comparators/debian_fallback.py | 2 +-
diffoscope/comparators/device.py | 5 +++--
diffoscope/comparators/dex.py | 5 +++--
diffoscope/comparators/directory.py | 5 +++--
diffoscope/comparators/elf.py | 9 +++++----
diffoscope/comparators/fonts.py | 5 +++--
diffoscope/comparators/fsimage.py | 5 +++--
diffoscope/comparators/gettext.py | 5 +++--
diffoscope/comparators/git.py | 3 ++-
diffoscope/comparators/gzip.py | 3 ++-
diffoscope/comparators/haskell.py | 5 +++--
diffoscope/comparators/icc.py | 5 +++--
diffoscope/comparators/image.py | 6 ++++--
diffoscope/comparators/ipk.py | 2 +-
diffoscope/comparators/iso9660.py | 7 ++++---
diffoscope/comparators/java.py | 5 +++--
diffoscope/comparators/javascript.py | 5 +++--
diffoscope/comparators/json.py | 7 ++++---
diffoscope/comparators/libarchive.py | 9 +++++----
diffoscope/comparators/llvm.py | 5 +++--
diffoscope/comparators/macho.py | 5 +++--
diffoscope/comparators/mono.py | 5 +++--
diffoscope/comparators/openssh.py | 5 +++--
diffoscope/comparators/pdf.py | 5 +++--
diffoscope/comparators/png.py | 5 +++--
diffoscope/comparators/ppu.py | 5 +++--
diffoscope/comparators/ps.py | 5 +++--
diffoscope/comparators/rpm.py | 5 +++--
diffoscope/comparators/rpm_fallback.py | 2 +-
diffoscope/comparators/rust.py | 2 +-
diffoscope/comparators/sqlite.py | 5 +++--
diffoscope/comparators/squashfs.py | 11 ++++++-----
diffoscope/comparators/symlink.py | 5 +++--
diffoscope/comparators/tar.py | 6 +++---
diffoscope/comparators/text.py | 3 ++-
diffoscope/comparators/utils.py | 5 +++--
diffoscope/comparators/xz.py | 5 +++--
diffoscope/comparators/zip.py | 7 ++++---
46 files changed, 146 insertions(+), 106 deletions(-)
diff --git a/diffoscope/comparators/apk.py b/diffoscope/comparators/apk.py
index 9b5e42c..b6c5271 100644
--- a/diffoscope/comparators/apk.py
+++ b/diffoscope/comparators/apk.py
@@ -22,8 +22,9 @@ import os.path
import subprocess
from diffoscope import logger, tool_required, get_temporary_directory
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.utils import Archive, get_compressed_content_name
+
+from .binary import File
+from .utils import Archive, get_compressed_content_name
class ApkContainer(Archive):
@property
diff --git a/diffoscope/comparators/ar.py b/diffoscope/comparators/ar.py
index 55a6a4b..c80d155 100644
--- a/diffoscope/comparators/ar.py
+++ b/diffoscope/comparators/ar.py
@@ -22,9 +22,10 @@ import re
from diffoscope import logger, tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.libarchive import LibarchiveContainer, \
+
+from .utils import Command
+from .binary import File
+from .libarchive import LibarchiveContainer, \
list_libarchive
diff --git a/diffoscope/comparators/binary.py b/diffoscope/comparators/binary.py
index 9f092e5..7211af9 100644
--- a/diffoscope/comparators/binary.py
+++ b/diffoscope/comparators/binary.py
@@ -54,11 +54,11 @@ def hexdump_fallback(path):
def compare_binary_files(file1, file2, source=None):
- import diffoscope.comparators.utils
+ from diffoscope.comparators.utils import Xxd
try:
return Difference.from_command(
- diffoscope.comparators.utils.Xxd, file1.path, file2.path,
+ Xxd, file1.path, file2.path,
source=[file1.name, file2.name], has_internal_linenos=True)
except RequiredToolNotFound:
hexdump1 = hexdump_fallback(file1.path)
diff --git a/diffoscope/comparators/bzip2.py b/diffoscope/comparators/bzip2.py
index 1337022..bbb2fcf 100644
--- a/diffoscope/comparators/bzip2.py
+++ b/diffoscope/comparators/bzip2.py
@@ -23,8 +23,9 @@ import subprocess
import collections
from diffoscope import logger, tool_required
-from diffoscope.comparators.utils import Archive, get_compressed_content_name
-from diffoscope.comparators.binary import File
+
+from .utils import Archive, get_compressed_content_name
+from .binary import File
class Bzip2Container(Archive):
diff --git a/diffoscope/comparators/cbfs.py b/diffoscope/comparators/cbfs.py
index 0003e8b..14ac377 100644
--- a/diffoscope/comparators/cbfs.py
+++ b/diffoscope/comparators/cbfs.py
@@ -25,8 +25,9 @@ import subprocess
from diffoscope import logger, tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Archive, Command
-from diffoscope.comparators.binary import File
+
+from .utils import Archive, Command
+from .binary import File
class CbfsListing(Command):
diff --git a/diffoscope/comparators/cpio.py b/diffoscope/comparators/cpio.py
index 1dc29c3..1048c26 100644
--- a/diffoscope/comparators/cpio.py
+++ b/diffoscope/comparators/cpio.py
@@ -22,9 +22,10 @@ import re
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.libarchive import LibarchiveContainer, list_libarchive
+
+from .utils import Command
+from .binary import File
+from .libarchive import LibarchiveContainer, list_libarchive
class CpioContent(Command):
diff --git a/diffoscope/comparators/deb.py b/diffoscope/comparators/deb.py
index b2046ac..d860b22 100644
--- a/diffoscope/comparators/deb.py
+++ b/diffoscope/comparators/deb.py
@@ -21,12 +21,12 @@ import re
from diffoscope import logger
from diffoscope.difference import Difference
-from diffoscope.comparators.tar import TarContainer
-from diffoscope.comparators.utils import ArchiveMember
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.libarchive import LibarchiveContainer, list_libarchive
-import diffoscope.comparators
+from . import specialize
+from .tar import TarContainer
+from .utils import ArchiveMember
+from .binary import File
+from .libarchive import LibarchiveContainer, list_libarchive
try:
from debian import deb822
@@ -43,7 +43,7 @@ def get_build_id_map(container):
# too many irrelevant files
if not member_name.endswith('.deb'):
continue
- diffoscope.comparators.specialize(member)
+ specialize(member)
if isinstance(member, DebFile) and member.control:
build_ids = member.control.get('Build-Ids', None)
if build_ids:
@@ -59,21 +59,21 @@ class DebContainer(LibarchiveContainer):
def data_tar(self):
for name, member in self.get_members().items():
if DebContainer.RE_DATA_TAR.match(name):
- diffoscope.comparators.specialize(member)
+ specialize(member)
if name.endswith('.tar'):
return member
else:
- return diffoscope.comparators.specialize(member.as_container.get_member('content'))
+ return specialize(member.as_container.get_member('content'))
@property
def control_tar(self):
for name, member in self.get_members().items():
if DebContainer.RE_CONTROL_TAR.match(name):
- diffoscope.comparators.specialize(member)
+ specialize(member)
if name.endswith('.tar'):
return member
else:
- return diffoscope.comparators.specialize(member.as_container.get_member('content'))
+ return specialize(member.as_container.get_member('content'))
class DebFile(File):
diff --git a/diffoscope/comparators/debian.py b/diffoscope/comparators/debian.py
index 188882d..98c52e4 100644
--- a/diffoscope/comparators/debian.py
+++ b/diffoscope/comparators/debian.py
@@ -28,8 +28,9 @@ from debian.deb822 import Dsc
from diffoscope import logger
from diffoscope.changes import Changes
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Container
-from diffoscope.comparators.binary import File
+
+from .utils import Container
+from .binary import File
DOT_CHANGES_FIELDS = [
diff --git a/diffoscope/comparators/debian_fallback.py b/diffoscope/comparators/debian_fallback.py
index 085f4e2..71ea392 100644
--- a/diffoscope/comparators/debian_fallback.py
+++ b/diffoscope/comparators/debian_fallback.py
@@ -19,7 +19,7 @@
import re
-from diffoscope.comparators.text import TextFile
+from .text import TextFile
class DotChangesFile(TextFile):
diff --git a/diffoscope/comparators/device.py b/diffoscope/comparators/device.py
index ea275e6..e94ee2a 100644
--- a/diffoscope/comparators/device.py
+++ b/diffoscope/comparators/device.py
@@ -21,8 +21,9 @@ import os
from diffoscope import get_named_temporary_file
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import format_device
-from diffoscope.comparators.binary import File, FilesystemFile
+
+from .utils import format_device
+from .binary import File, FilesystemFile
class Device(File):
diff --git a/diffoscope/comparators/dex.py b/diffoscope/comparators/dex.py
index d7f6fee..7ac9208 100644
--- a/diffoscope/comparators/dex.py
+++ b/diffoscope/comparators/dex.py
@@ -23,8 +23,9 @@ import subprocess
import collections
from diffoscope import logger, tool_required
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.utils import Archive, get_compressed_content_name
+
+from .binary import File
+from .utils import Archive, get_compressed_content_name
class DexContainer(Archive):
diff --git a/diffoscope/comparators/directory.py b/diffoscope/comparators/directory.py
index ce37571..102bc94 100644
--- a/diffoscope/comparators/directory.py
+++ b/diffoscope/comparators/directory.py
@@ -25,8 +25,9 @@ from diffoscope import logger, tool_required
from diffoscope.exc import RequiredToolNotFound
from diffoscope.progress import Progress
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Container, Command
-from diffoscope.comparators.binary import FilesystemFile
+
+from .utils import Container, Command
+from .binary import FilesystemFile
from .compare import compare_files
diff --git a/diffoscope/comparators/elf.py b/diffoscope/comparators/elf.py
index 4676df2..c5fd12b 100644
--- a/diffoscope/comparators/elf.py
+++ b/diffoscope/comparators/elf.py
@@ -25,10 +25,11 @@ import collections
from diffoscope import tool_required, logger, get_named_temporary_file
from diffoscope.exc import OutputParsingError
from diffoscope.difference import Difference
-from diffoscope.comparators.deb import DebFile, get_build_id_map
-from diffoscope.comparators.utils import Command, Container
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.libarchive import list_libarchive
+
+from .deb import DebFile, get_build_id_map
+from .utils import Command, Container
+from .binary import File
+from .libarchive import list_libarchive
class Readelf(Command):
diff --git a/diffoscope/comparators/fonts.py b/diffoscope/comparators/fonts.py
index 62767ef..a8855ad 100644
--- a/diffoscope/comparators/fonts.py
+++ b/diffoscope/comparators/fonts.py
@@ -21,8 +21,9 @@ import re
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class Showttf(Command):
diff --git a/diffoscope/comparators/fsimage.py b/diffoscope/comparators/fsimage.py
index 132bac6..22ba92b 100644
--- a/diffoscope/comparators/fsimage.py
+++ b/diffoscope/comparators/fsimage.py
@@ -23,8 +23,9 @@ import collections
from diffoscope import logger
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Archive
-from diffoscope.comparators.binary import File
+
+from .utils import Archive
+from .binary import File
try:
import guestfs
diff --git a/diffoscope/comparators/gettext.py b/diffoscope/comparators/gettext.py
index a82d2a1..bd1d936 100644
--- a/diffoscope/comparators/gettext.py
+++ b/diffoscope/comparators/gettext.py
@@ -23,8 +23,9 @@ import re
from diffoscope import logger
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class Msgunfmt(Command):
diff --git a/diffoscope/comparators/git.py b/diffoscope/comparators/git.py
index 85e2898..99e5f5e 100644
--- a/diffoscope/comparators/git.py
+++ b/diffoscope/comparators/git.py
@@ -23,7 +23,8 @@ import struct
import binascii
from diffoscope.difference import Difference
-from diffoscope.comparators.binary import File
+
+from .binary import File
class GitIndexFile(File):
diff --git a/diffoscope/comparators/gzip.py b/diffoscope/comparators/gzip.py
index 29939a3..61751c1 100644
--- a/diffoscope/comparators/gzip.py
+++ b/diffoscope/comparators/gzip.py
@@ -24,7 +24,8 @@ import collections
from diffoscope import logger, tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Archive, get_compressed_content_name
+
+from .utils import Archive, get_compressed_content_name
class GzipContainer(Archive):
diff --git a/diffoscope/comparators/haskell.py b/diffoscope/comparators/haskell.py
index 7630941..9e27b67 100644
--- a/diffoscope/comparators/haskell.py
+++ b/diffoscope/comparators/haskell.py
@@ -25,8 +25,9 @@ import subprocess
from diffoscope import tool_required, logger
from diffoscope.profiling import profile
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class ShowIface(Command):
diff --git a/diffoscope/comparators/icc.py b/diffoscope/comparators/icc.py
index c812312..5b80351 100644
--- a/diffoscope/comparators/icc.py
+++ b/diffoscope/comparators/icc.py
@@ -21,8 +21,9 @@ import re
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class Iccdump(Command):
diff --git a/diffoscope/comparators/image.py b/diffoscope/comparators/image.py
index 32a4b6c..9486aed 100644
--- a/diffoscope/comparators/image.py
+++ b/diffoscope/comparators/image.py
@@ -21,11 +21,13 @@ import re
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
re_ansi_escapes = re.compile(r'\x1b[^m]*m')
+
class Img2Txt(Command):
@tool_required('img2txt')
def cmdline(self):
diff --git a/diffoscope/comparators/ipk.py b/diffoscope/comparators/ipk.py
index 5e39025..785ee5d 100644
--- a/diffoscope/comparators/ipk.py
+++ b/diffoscope/comparators/ipk.py
@@ -20,7 +20,7 @@
import re
-from diffoscope.comparators.gzip import GzipFile
+from .gzip import GzipFile
class IpkFile(GzipFile):
diff --git a/diffoscope/comparators/iso9660.py b/diffoscope/comparators/iso9660.py
index 762bff9..dfba4b9 100644
--- a/diffoscope/comparators/iso9660.py
+++ b/diffoscope/comparators/iso9660.py
@@ -22,9 +22,10 @@ import subprocess
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.libarchive import LibarchiveContainer
+
+from .utils import Command
+from .binary import File
+from .libarchive import LibarchiveContainer
@tool_required('isoinfo')
diff --git a/diffoscope/comparators/java.py b/diffoscope/comparators/java.py
index d53f287..cc734e6 100644
--- a/diffoscope/comparators/java.py
+++ b/diffoscope/comparators/java.py
@@ -23,8 +23,9 @@ import os.path
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class Javap(Command):
diff --git a/diffoscope/comparators/javascript.py b/diffoscope/comparators/javascript.py
index 18892f1..166d9f4 100644
--- a/diffoscope/comparators/javascript.py
+++ b/diffoscope/comparators/javascript.py
@@ -21,8 +21,9 @@ import re
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class JavaScriptBeautify(Command):
diff --git a/diffoscope/comparators/json.py b/diffoscope/comparators/json.py
index 40c9f4f..7f1a340 100644
--- a/diffoscope/comparators/json.py
+++ b/diffoscope/comparators/json.py
@@ -17,12 +17,13 @@
# You should have received a copy of the GNU General Public License
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
-from collections import OrderedDict
import re
import json
+import collections
from diffoscope.difference import Difference
-from diffoscope.comparators.binary import File
+
+from .binary import File
class JSONFile(File):
@@ -35,7 +36,7 @@ class JSONFile(File):
with open(file.path) as f:
try:
- file.parsed = json.load(f, object_pairs_hook=OrderedDict)
+ file.parsed = json.load(f, object_pairs_hook=collections.OrderedDict)
except json.JSONDecodeError:
return False
diff --git a/diffoscope/comparators/libarchive.py b/diffoscope/comparators/libarchive.py
index d332b08..055cf04 100644
--- a/diffoscope/comparators/libarchive.py
+++ b/diffoscope/comparators/libarchive.py
@@ -24,10 +24,11 @@ import ctypes
import libarchive
from diffoscope import logger, get_temporary_directory
-from diffoscope.comparators.utils import Archive, ArchiveMember
-from diffoscope.comparators.device import Device
-from diffoscope.comparators.symlink import Symlink
-from diffoscope.comparators.directory import Directory
+
+from .utils import Archive, ArchiveMember
+from .device import Device
+from .symlink import Symlink
+from .directory import Directory
# Monkeypatch libarchive-c (<< 2.2)
diff --git a/diffoscope/comparators/llvm.py b/diffoscope/comparators/llvm.py
index ad19bb7..7987958 100644
--- a/diffoscope/comparators/llvm.py
+++ b/diffoscope/comparators/llvm.py
@@ -20,8 +20,9 @@
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class LlvmBcAnalyzer(Command):
diff --git a/diffoscope/comparators/macho.py b/diffoscope/comparators/macho.py
index 9149c3f..6453c35 100644
--- a/diffoscope/comparators/macho.py
+++ b/diffoscope/comparators/macho.py
@@ -23,8 +23,9 @@ import subprocess
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class Otool(Command):
diff --git a/diffoscope/comparators/mono.py b/diffoscope/comparators/mono.py
index d81f0ba..d0d0cc9 100644
--- a/diffoscope/comparators/mono.py
+++ b/diffoscope/comparators/mono.py
@@ -22,8 +22,9 @@ import re
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class Pedump(Command):
diff --git a/diffoscope/comparators/openssh.py b/diffoscope/comparators/openssh.py
index f912fb0..26c521a 100644
--- a/diffoscope/comparators/openssh.py
+++ b/diffoscope/comparators/openssh.py
@@ -21,8 +21,9 @@ import re
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class SSHKeyList(Command):
diff --git a/diffoscope/comparators/pdf.py b/diffoscope/comparators/pdf.py
index 50a271d..9514812 100644
--- a/diffoscope/comparators/pdf.py
+++ b/diffoscope/comparators/pdf.py
@@ -21,8 +21,9 @@ import re
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class Pdftotext(Command):
diff --git a/diffoscope/comparators/png.py b/diffoscope/comparators/png.py
index 1d5ceb4..f03ab40 100644
--- a/diffoscope/comparators/png.py
+++ b/diffoscope/comparators/png.py
@@ -22,8 +22,9 @@ import functools
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class Sng(Command):
diff --git a/diffoscope/comparators/ppu.py b/diffoscope/comparators/ppu.py
index 2577816..5acc16c 100644
--- a/diffoscope/comparators/ppu.py
+++ b/diffoscope/comparators/ppu.py
@@ -26,8 +26,9 @@ import subprocess
from diffoscope import tool_required, logger
from diffoscope.profiling import profile
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Command
-from diffoscope.comparators.binary import File
+
+from .utils import Command
+from .binary import File
class Ppudump(Command):
diff --git a/diffoscope/comparators/ps.py b/diffoscope/comparators/ps.py
index d2531ae..203e40c 100644
--- a/diffoscope/comparators/ps.py
+++ b/diffoscope/comparators/ps.py
@@ -22,8 +22,9 @@ import re
from diffoscope import tool_required, logger
from diffoscope.exc import RequiredToolNotFound
from diffoscope.difference import Difference
-from diffoscope.comparators.text import TextFile
-from diffoscope.comparators.utils import Command
+
+from .text import TextFile
+from .utils import Command
class Pstotext(Command):
diff --git a/diffoscope/comparators/rpm.py b/diffoscope/comparators/rpm.py
index 274f2e4..6a8e122 100644
--- a/diffoscope/comparators/rpm.py
+++ b/diffoscope/comparators/rpm.py
@@ -26,8 +26,9 @@ import subprocess
from diffoscope import logger, tool_required, get_temporary_directory
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Archive
-from diffoscope.comparators.rpm_fallback import AbstractRpmFile
+
+from .utils import Archive
+from .rpm_fallback import AbstractRpmFile
def convert_header_field(io, header):
diff --git a/diffoscope/comparators/rpm_fallback.py b/diffoscope/comparators/rpm_fallback.py
index c8ca1c7..22b3e74 100644
--- a/diffoscope/comparators/rpm_fallback.py
+++ b/diffoscope/comparators/rpm_fallback.py
@@ -19,7 +19,7 @@
import re
-from diffoscope.comparators.binary import File
+from .binary import File
class AbstractRpmFile(File):
diff --git a/diffoscope/comparators/rust.py b/diffoscope/comparators/rust.py
index 673fa35..eb25869 100644
--- a/diffoscope/comparators/rust.py
+++ b/diffoscope/comparators/rust.py
@@ -24,8 +24,8 @@ import collections
from diffoscope import logger, tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Archive, get_compressed_content_name
+from .utils import Archive, get_compressed_content_name
RLIB_BYTECODE_OBJECT_V1_DATASIZE_OFFSET = 15
RLIB_BYTECODE_OBJECT_V1_DATA_OFFSET = 23
diff --git a/diffoscope/comparators/sqlite.py b/diffoscope/comparators/sqlite.py
index 58e4ff1..74a0fa0 100644
--- a/diffoscope/comparators/sqlite.py
+++ b/diffoscope/comparators/sqlite.py
@@ -19,8 +19,9 @@
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.utils import Command
+
+from .utils import Command
+from .binary import File
class Sqlite3Dump(Command):
diff --git a/diffoscope/comparators/squashfs.py b/diffoscope/comparators/squashfs.py
index 4bfb04e..92b5219 100644
--- a/diffoscope/comparators/squashfs.py
+++ b/diffoscope/comparators/squashfs.py
@@ -25,11 +25,12 @@ import collections
from diffoscope import logger, tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Archive, ArchiveMember, Command
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.device import Device
-from diffoscope.comparators.symlink import Symlink
-from diffoscope.comparators.directory import Directory
+
+from .utils import Archive, ArchiveMember, Command
+from .binary import File
+from .device import Device
+from .symlink import Symlink
+from .directory import Directory
class SquashfsSuperblock(Command):
diff --git a/diffoscope/comparators/symlink.py b/diffoscope/comparators/symlink.py
index a0f4e2f..984c925 100644
--- a/diffoscope/comparators/symlink.py
+++ b/diffoscope/comparators/symlink.py
@@ -21,8 +21,9 @@ import os
from diffoscope import logger, get_named_temporary_file
from diffoscope.difference import Difference
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.utils import format_symlink
+
+from .binary import File
+from .utils import format_symlink
class Symlink(File):
diff --git a/diffoscope/comparators/tar.py b/diffoscope/comparators/tar.py
index 827ecab..8e96ef9 100644
--- a/diffoscope/comparators/tar.py
+++ b/diffoscope/comparators/tar.py
@@ -20,9 +20,9 @@
import re
from diffoscope.difference import Difference
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.libarchive import LibarchiveContainer, \
- list_libarchive
+
+from .binary import File
+from .libarchive import LibarchiveContainer, list_libarchive
class TarContainer(LibarchiveContainer):
pass
diff --git a/diffoscope/comparators/text.py b/diffoscope/comparators/text.py
index f7f423f..8d59dc6 100644
--- a/diffoscope/comparators/text.py
+++ b/diffoscope/comparators/text.py
@@ -21,7 +21,8 @@ import re
import codecs
from diffoscope.difference import Difference
-from diffoscope.comparators.binary import File
+
+from .binary import File
def order_only_difference(unified_diff):
diff --git a/diffoscope/comparators/utils.py b/diffoscope/comparators/utils.py
index a29c17c..6da35cb 100644
--- a/diffoscope/comparators/utils.py
+++ b/diffoscope/comparators/utils.py
@@ -31,8 +31,9 @@ from diffoscope import logger, tool_required, get_temporary_directory
from diffoscope.config import Config
from diffoscope.progress import Progress
from diffoscope.profiling import profile
-from diffoscope.comparators.binary import File, NonExistingFile
+from . import specialize, perform_fuzzy_matching
+from .binary import File, NonExistingFile
from .compare import compare_commented_files
class Command(object, metaclass=abc.ABCMeta):
@@ -182,7 +183,7 @@ class Container(object, metaclass=abc.ABCMeta):
except KeyError:
return None
logger.debug('lookup_file(%s) -> %s', names, file)
- diffoscope.comparators.specialize(file)
+ specialize(file)
if not remainings:
return file
container = file.as_container
diff --git a/diffoscope/comparators/xz.py b/diffoscope/comparators/xz.py
index 442d62f..0fc614d 100644
--- a/diffoscope/comparators/xz.py
+++ b/diffoscope/comparators/xz.py
@@ -23,8 +23,9 @@ import subprocess
import collections
from diffoscope import logger, tool_required
-from diffoscope.comparators.utils import Archive, get_compressed_content_name
-from diffoscope.comparators.binary import File
+
+from .utils import Archive, get_compressed_content_name
+from .binary import File
class XzContainer(Archive):
diff --git a/diffoscope/comparators/zip.py b/diffoscope/comparators/zip.py
index 0303db3..4b86693 100644
--- a/diffoscope/comparators/zip.py
+++ b/diffoscope/comparators/zip.py
@@ -26,9 +26,10 @@ import contextlib
from diffoscope import tool_required
from diffoscope.difference import Difference
-from diffoscope.comparators.utils import Archive, ArchiveMember, Command
-from diffoscope.comparators.binary import File
-from diffoscope.comparators.directory import Directory
+
+from .utils import Archive, ArchiveMember, Command
+from .binary import File
+from .directory import Directory
class Zipinfo(Command):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list