Skip to content
Snippets Groups Projects
Commit 28aa66ee authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

PEP8: E121, E122, E126, E128 - Fix badly indented lines.

parent c8198fce
No related branches found
No related tags found
No related merge requests found
......@@ -160,7 +160,7 @@ class ApkFile(File):
def compare_details(self, other, source=None):
zipinfo_difference = Difference.from_command(Zipinfo, self.path, other.path) or \
Difference.from_command(ZipinfoVerbose, self.path, other.path)
Difference.from_command(ZipinfoVerbose, self.path, other.path)
return [zipinfo_difference]
......
......@@ -139,11 +139,11 @@ class Md5sumsFile(File):
@classmethod
def recognizes(cls, file):
return isinstance(file, ArchiveMember) and \
file.name == './md5sums' and \
isinstance(file.container.source, ArchiveMember) and \
isinstance(file.container.source.container.source, ArchiveMember) and \
DebContainer.RE_CONTROL_TAR.match(file.container.source.container.source.name) and \
isinstance(file.container.source.container.source.container.source, DebFile)
file.name == './md5sums' and \
isinstance(file.container.source, ArchiveMember) and \
isinstance(file.container.source.container.source, ArchiveMember) and \
DebContainer.RE_CONTROL_TAR.match(file.container.source.container.source.name) and \
isinstance(file.container.source.container.source.container.source, DebFile)
def parse(self):
try:
......@@ -193,9 +193,9 @@ class DebDataTarFile(File):
@classmethod
def recognizes(cls, file):
return isinstance(file, ArchiveMember) and \
isinstance(file.container.source, ArchiveMember) and \
DebContainer.RE_DATA_TAR.match(file.container.source.name) and \
isinstance(file.container.source.container.source, DebFile)
isinstance(file.container.source, ArchiveMember) and \
DebContainer.RE_DATA_TAR.match(file.container.source.name) and \
isinstance(file.container.source.container.source, DebFile)
def compare_details(self, other, source=None):
return [Difference.from_text_readers(list_libarchive(self.path),
......
......@@ -71,7 +71,7 @@ class Device(File):
def compare(self, other, source=None):
with open(self.path) as my_content, \
open(other.path) as other_content:
open(other.path) as other_content:
return Difference.from_text_readers(my_content, other_content, self.name, other.name, source=source, comment="device")
......
......@@ -62,5 +62,5 @@ class Symlink(File):
def compare(self, other, source=None):
with open(self.path) as my_content, \
open(other.path) as other_content:
open(other.path) as other_content:
return Difference.from_text_readers(my_content, other_content, self.name, other.name, source=source, comment="symlink")
......@@ -50,7 +50,7 @@ class TextFile(File):
other_encoding = other.encoding or 'utf-8'
try:
with codecs.open(self.path, 'r', encoding=my_encoding) as my_content, \
codecs.open(other.path, 'r', encoding=other_encoding) as other_content:
codecs.open(other.path, 'r', encoding=other_encoding) as other_content:
difference = Difference.from_text_readers(my_content, other_content, self.name, other.name, source)
# Check if difference is only in line order.
if difference and order_only_difference(difference.unified_diff):
......
......@@ -305,9 +305,9 @@ class File(object, metaclass=abc.ABCMeta):
if self.as_container.auto_diff_metadata:
details.extend([
Difference.from_text(self.magic_file_type, other.magic_file_type, self, other,
source='filetype from file(1)'),
source='filetype from file(1)'),
Difference.from_text(self.__class__.__name__, other.__class__.__name__, self, other,
source='filetype from diffoscope'),
source='filetype from diffoscope'),
])
# Don't recursve forever on archive quines, etc.
depth = self._as_container.depth
......
......@@ -114,8 +114,8 @@ class ZipFile(File):
def compare_details(self, other, source=None):
zipinfo_difference = Difference.from_command(Zipinfo, self.path, other.path) or \
Difference.from_command(ZipinfoVerbose, self.path, other.path) or \
Difference.from_command(BsdtarVerbose, self.path, other.path)
Difference.from_command(ZipinfoVerbose, self.path, other.path) or \
Difference.from_command(BsdtarVerbose, self.path, other.path)
return [zipinfo_difference]
......@@ -164,6 +164,6 @@ class MozillaZipFile(File):
def compare_details(self, other, source=None):
zipinfo_difference = Difference.from_command(MozillaZipinfo, self.path, other.path) or \
Difference.from_command(MozillaZipinfoVerbose, self.path, other.path) or \
Difference.from_command(BsdtarVerbose, self.path, other.path)
Difference.from_command(MozillaZipinfoVerbose, self.path, other.path) or \
Difference.from_command(BsdtarVerbose, self.path, other.path)
return [zipinfo_difference]
......@@ -138,24 +138,24 @@ def create_parser():
'as --html, may be restricted by even smaller limits '
'such as --max-page-size. (0 to disable, default: %d)' %
Config().max_report_size, default=None).completer = RangeCompleter(
Config().max_report_size)
Config().max_report_size)
group2.add_argument('--max-diff-block-lines', metavar='LINES', type=int,
help='Maximum number of lines output per unified-diff '
'block, across all pages. (0 to disable, default: %d)' %
Config().max_diff_block_lines, default=None).completer = RangeCompleter(
Config().max_diff_block_lines)
Config().max_diff_block_lines)
group2.add_argument('--max-page-size', metavar='BYTES', type=int,
help='Maximum bytes of the top-level (--html-dir) or sole '
'(--html) page. (default: %(default)s, remains in effect '
'even with --no-default-limits)', default=
Config().max_page_size).completer = RangeCompleter(
Config().max_page_size)
Config().max_page_size)
group2.add_argument('--max-page-size-child', metavar='BYTES', type=int,
help='In --html-dir output, this is the maximum bytes of '
'each child page (default: %(default)s, remains in '
'effect even with --no-default-limits)', default=str(
Config().max_page_size_child)).completer = RangeCompleter(
Config().max_page_size_child)
Config().max_page_size_child)).completer = RangeCompleter(
Config().max_page_size_child)
# TODO: old flag kept for backwards-compat, drop 6 months after v84
group2.add_argument('--max-report-size-child', metavar='BYTES', type=int,
help=argparse.SUPPRESS, default=None)
......@@ -167,7 +167,7 @@ def create_parser():
'--max-page-size-child. (default: %(default)s, remains in '
'effect even with --no-default-limits)', default=
Config().max_page_diff_block_lines).completer = RangeCompleter(
Config().max_page_diff_block_lines)
Config().max_page_diff_block_lines)
# TODO: old flag kept for backwards-compat, drop 6 months after v84
group2.add_argument("--max-diff-block-lines-parent", metavar='LINES', type=int,
help=argparse.SUPPRESS, default=None)
......@@ -214,7 +214,7 @@ def create_parser():
'(0 to disable, default: %d)' %
Config().max_diff_input_lines,
default=None).completer = RangeCompleter(
Config().max_diff_input_lines)
Config().max_diff_input_lines)
group3.add_argument('--max-container-depth', metavar='DEPTH', type=int,
help='Maximum depth to recurse into containers. '
'(Cannot be disabled for security reasons, default: '
......
......@@ -45,7 +45,7 @@ setup(
cmdclass={'test': PyTest},
entry_points={
'console_scripts': [
'diffoscope=diffoscope.main:main'
'diffoscope=diffoscope.main:main'
],
},
install_requires=[
......
......@@ -92,7 +92,7 @@ def skip_if_binutils_does_not_support_x86():
return skip_unless_tools_exist('objdump')
return pytest.mark.skipif(
'elf64-x86-64' not in get_supported_elf_formats(),
'elf64-x86-64' not in get_supported_elf_formats(),
reason="requires a binutils capable of reading x86-64 binaries"
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment