From 9101a1fe1db6692c75a94bb40636b6f0d68aa15c Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Fri, 20 Sep 2013 15:08:58 +0800 Subject: [PATCH] Compare vpos with 0 in ReadCommentsNiconico --- convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert.py b/convert.py index 05b958b..6207ab9 100755 --- a/convert.py +++ b/convert.py @@ -124,7 +124,7 @@ def ReadCommentsNiconico(f, fontsize): size = fontsize*0.64 elif mailstyle in NiconicoColorMap: color = NiconicoColorMap[mailstyle] - yield (int(comment.getAttribute('vpos'))*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')), int(comment.getAttribute('no')), c, pos, color, size, (c.count('\n')+1)*size, CalculateLength(c)*size) i += 1 except (AssertionError, AttributeError, IndexError, TypeError, ValueError): logging.warning('Invalid comment: %s' % comment.toxml())