mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
A nicer repr for Tag objects
This commit is contained in:
parent
d31bf5a1ac
commit
e10538e05c
@ -36,6 +36,11 @@ class Tag(object):
|
|||||||
self.name = tag
|
self.name = tag
|
||||||
self.self_closing = self_closing
|
self.self_closing = self_closing
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return '<%s start_block=%s start_offset=%s end_block=%s end_offset=%s self_closing=%s>' % (
|
||||||
|
self.name, self.start_block.blockNumber(), self.start_offset, self.end_block.blockNumber(), self.end_offset, self.self_closing)
|
||||||
|
__str__ = __repr__
|
||||||
|
|
||||||
def next_tag_boundary(block, offset, forward=True):
|
def next_tag_boundary(block, offset, forward=True):
|
||||||
while block.isValid():
|
while block.isValid():
|
||||||
ud = block.userData()
|
ud = block.userData()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user