Remove Image.key, add Letter.key.

This commit is contained in:
Andrey Golovizin 2014-08-15 18:09:43 +02:00
parent 08a6d004e7
commit a537f2140c
2 changed files with 6 additions and 5 deletions

View file

@ -127,11 +127,6 @@ class Image(object):
def isspace(self):
return not _is_nonblank(self.bitmap)
@property
def key(self):
"""Return a byte string uniquely representing the image."""
return self.tostring()
def tostring(self):
"""Serialize the image as a string."""
height, width, *_ = self.shape

View file

@ -165,6 +165,12 @@ class Letter(PageObject):
super().__init__(image)
self.elevation = elevation
@property
def key(self):
"""Return a dictionary key uniquely representing this letter."""
return self.elevation, self.image.tostring()
class Space(Letter):
pass