[vb2py-users] Faulty assumption in hex color regular expression.
Status: Pre-Alpha
Brought to you by:
paulpaterson
From: Nils R G. <ni...@pa...> - 2003-07-29 20:12:27
|
In line 416 in vb2py.py: pattern = re.compile("\&H00([A-F0-9]{6})\&", re.MULTILINE) assumes that all colors starts with "&H00". They don't. System color constants start with "&H80" as far as I can see, so no replacement is done in such cases. The following exec then fails, of course. pattern = re.compile("\&H([A-F0-9]{8})\&", re.MULTILINE) def sub_hex(match): txt = match.groups()[0] return "(%d, %d, %d)" % (int(txt[2:4], 16), int(txt[4:6], 16), int(txt[6:8], 16)) would "fix" it, but most likely give very silly colors for system color cases. Nils |