From 60a77477c94bfcebb960f83a71a956cd5ad7bf00 Mon Sep 17 00:00:00 2001 From: jevans Date: Sat, 26 Oct 2013 18:21:24 -0400 Subject: [PATCH] Pylint issues, #104 --- glymur/_uuid_io/Exif.py | 2 +- glymur/_uuid_io/__init__.py | 4 +++- glymur/jp2box.py | 12 ++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/glymur/_uuid_io/Exif.py b/glymur/_uuid_io/Exif.py index 0a86c18..ccc03dd 100644 --- a/glymur/_uuid_io/Exif.py +++ b/glymur/_uuid_io/Exif.py @@ -62,7 +62,7 @@ class UUIDExif(object): interop = _ExifInteroperabilityIfd(self.endian, read_buffer[6:], offset) - iop = interop.processed_ifd + exif_iop = interop.processed_ifd if 'GPSTag' in exif_image.keys(): offset = exif_image['GPSTag'] diff --git a/glymur/_uuid_io/__init__.py b/glymur/_uuid_io/__init__.py index 5545351..a23c2ce 100644 --- a/glymur/_uuid_io/__init__.py +++ b/glymur/_uuid_io/__init__.py @@ -1,4 +1,6 @@ +""" +Sub package for handling various UUIDs. +""" from .Exif import UUIDExif from .XMP import UUIDXMP from .generic import UUIDGeneric - diff --git a/glymur/jp2box.py b/glymur/jp2box.py index 074d18e..34eeeb8 100644 --- a/glymur/jp2box.py +++ b/glymur/jp2box.py @@ -2089,7 +2089,7 @@ class UUIDBox(Jp2kBox): else: self.data = _uuid_io.UUIDGeneric(raw_data) self._type = 'unknown' - except Exception as err: + except Exception: # In case of any exception, create the generic UUID. self.data = _uuid_io.UUIDGeneric(raw_data) self._type = 'unknown' @@ -2121,15 +2121,15 @@ class UUIDBox(Jp2kBox): if self._type != 'XMP': msg = "Only XMP UUID boxes can currently be written." raise NotImplementedError(msg) - serialized_buffer = b'' - serialized_buffer += ET.tostring(self.data.getroot(), encoding='utf-8') - serialized_buffer += b'' + serialized = b'' + serialized += ET.tostring(self.data.packet.getroot(), encoding='utf-8') + serialized += b'' if self.length == 0: - self.length = 24 + len(serialized_buffer) + self.length = 24 + len(serialized) read_buffer = struct.pack('>I4s', self.length, b'uuid') fptr.write(read_buffer) fptr.write(self.uuid.bytes) - fptr.write(serialized_buffer) + fptr.write(serialized) @staticmethod def parse(fptr, offset, length):