Fix errors occured when the attribute 'no' doesn't exist
This commit is contained in:
parent
f71ef49f26
commit
b53fc11b37
@ -144,7 +144,7 @@ def ReadCommentsNiconico(f, fontsize):
|
|||||||
size = fontsize * 0.64
|
size = fontsize * 0.64
|
||||||
elif mailstyle in NiconicoColorMap:
|
elif mailstyle in NiconicoColorMap:
|
||||||
color = NiconicoColorMap[mailstyle]
|
color = NiconicoColorMap[mailstyle]
|
||||||
yield (max(int(comment.getAttribute('vpos')), 0) * 0.01, int(comment.getAttribute('date')), int(comment.getAttribute('no')), c, pos, color, size, (c.count('\n') + 1) * size, CalculateLength(c) * size)
|
yield (max(int(comment.getAttribute('vpos')), 0) * 0.01, int(comment.getAttribute('date')), 0, c, pos, color, size, (c.count('\n') + 1) * size, CalculateLength(c) * size)
|
||||||
except (AssertionError, AttributeError, IndexError, TypeError, ValueError):
|
except (AssertionError, AttributeError, IndexError, TypeError, ValueError):
|
||||||
logging.warning(_('Invalid comment: %s') % comment.toxml())
|
logging.warning(_('Invalid comment: %s') % comment.toxml())
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user