Reformat code

This commit is contained in:
Star Brilliant 2013-10-13 14:56:51 +08:00
parent 65f37d05dc
commit cab81e36ea

View File

@ -191,7 +191,6 @@ def ReadCommentsSH5V (f, fontsize):
c_color = str(comment['color']) c_color = str(comment['color'])
c = str(comment['text']) c = str(comment['text'])
size = fontsize size = fontsize
#print(c_at,' ',round(float(c_at),2),' ',c)
yield (float(c_at), int(c_date), i, c, {'0': 0, '1': 0, '4': 2, '5': 1}[c_type], int(c_color[1:], 16), size, (c.count('\n')+1)*size, CalculateLength(c)*size) yield (float(c_at), int(c_date), i, c, {'0': 0, '1': 0, '4': 2, '5': 1}[c_type], int(c_color[1:], 16), 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):
@ -226,7 +225,7 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
def NeedWhiteBorder(rgb): def NeedWhiteBorder(rgb):
h, l, s = colorsys.rgb_to_hls(((rgb>>16)&0xff)/255, ((rgb>>8)&0xff)/255, (rgb&0xff)/255) h, l, s = colorsys.rgb_to_hls(((rgb >> 16) & 0xff)/255.0, ((rgb >> 8) & 0xff)/255.0, (rgb & 0xff)/255.0)
return (1/12 < h < 7/12 and l < 1/3) or l < 5/12 return (1/12 < h < 7/12 and l < 1/3) or l < 5/12