Fix timestamp problem

This commit is contained in:
Star Brilliant 2013-11-03 02:21:54 +08:00
parent da632631a2
commit 0563194b82

View File

@ -190,7 +190,7 @@ def ReadCommentsMioMio(f, fontsize):
c = str(message.childNodes[0].wholeText) c = str(message.childNodes[0].wholeText)
pos = 0 pos = 0
size = int(message.getAttribute('fontsize'))*fontsize/25.0 size = int(message.getAttribute('fontsize'))*fontsize/25.0
yield (float(comment.getElementsByTagName('playTime')[0].childNodes[0].wholeText), int(calendar.timegm(time.strptime(comment.getElementsByTagName('times')[0].childNodes[0].wholeText, '%Y-%m-%d %H:%M:%S')))+28800, i, c, {'1': 0, '4': 2, '5': 1}[message.getAttribute('mode')], int(message.getAttribute('color')), size, (c.count('\n')+1)*size, CalculateLength(c)*size) yield (float(comment.getElementsByTagName('playTime')[0].childNodes[0].wholeText), int(calendar.timegm(time.strptime(comment.getElementsByTagName('times')[0].childNodes[0].wholeText, '%Y-%m-%d %H:%M:%S')))-28800, i, c, {'1': 0, '4': 2, '5': 1}[message.getAttribute('mode')], int(message.getAttribute('color')), size, (c.count('\n')+1)*size, CalculateLength(c)*size)
i += 1 i += 1
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())