PEP 8 - line length

This commit is contained in:
J Alan Brogan
2014-12-22 20:18:54 +00:00
parent 39fb7fc9b7
commit a5930b486c

View File

@ -15,13 +15,17 @@ class Letter(WorkspaceObject):
def describe(self, position, length): def describe(self, position, length):
if length == 1: if length == 1:
self.addDescription(slipnet.stringPositionCategory, slipnet.single) self.addDescription(slipnet.stringPositionCategory,
slipnet.single)
if self.leftmost and length > 1: # ? why check length ? if self.leftmost and length > 1: # ? why check length ?
self.addDescription(slipnet.stringPositionCategory, slipnet.leftmost) self.addDescription(slipnet.stringPositionCategory,
slipnet.leftmost)
if self.rightmost and length > 1: # ? why check length ? if self.rightmost and length > 1: # ? why check length ?
self.addDescription(slipnet.stringPositionCategory, slipnet.rightmost) self.addDescription(slipnet.stringPositionCategory,
slipnet.rightmost)
if length > 2 and position * 2 == length + 1: if length > 2 and position * 2 == length + 1:
self.addDescription(slipnet.stringPositionCategory, slipnet.middle) self.addDescription(slipnet.stringPositionCategory,
slipnet.middle)
def __repr__(self): def __repr__(self):
return '<Letter: %s>' % self.__str__() return '<Letter: %s>' % self.__str__()
@ -31,11 +35,12 @@ class Letter(WorkspaceObject):
return '' return ''
i = self.leftIndex - 1 i = self.leftIndex - 1
if len(self.string) <= i: if len(self.string) <= i:
raise ValueError('len(self.string) <= self.leftIndex :: %d <= %d' % (len(self.string), self.leftIndex)) raise ValueError('len(self.string) <= self.leftIndex :: %d <= %d',
len(self.string), self.leftIndex)
return self.string[i] return self.string[i]
def distinguishingDescriptor(self, descriptor): def distinguishingDescriptor(self, descriptor):
"""Whether no other object of the same type (letter) has the same descriptor""" """Whether no other object of the same type has the same descriptor"""
if not WorkspaceObject.distinguishingDescriptor(self, descriptor): if not WorkspaceObject.distinguishingDescriptor(self, descriptor):
return False return False
for objekt in self.string.objects: for objekt in self.string.objects: