Added multiple code sets. Future proofed code set adding.

This commit is contained in:
Fletcher Boyd 2013-09-06 14:23:33 +08:00
parent d9324eaf95
commit 2103c64dd5

View file

@ -1,21 +1,26 @@
def bb(format_string): def bb(format_string):
rep = {'[b]':'\x02', stuff = {}
'[White]':'\x030', stuff['col'] = {'[white]':'\x030',
'[Black]':'\x031', '[black]':'\x031',
'[dBlue]':'\x032', '[dblue]':'\x032',
'[dGreen]':'\x033', '[dgreen]':'\x033',
'[dRed]':'\x034', '[dred]':'\x034',
'[Brown]':'\x035', '[brown]':'\x035',
'[Purple]':'\x036', '[purple]':'\x036',
'[Gold]':'\x037', '[gold]':'\x037',
'Yellow':'\x038', '[yellow]':'\x038',
'[Green]':'\x039', '[green]':'\x039',
'[Cyan]':'\x0310', '[cyan]':'\x0310',
'[lBlue]':'\x0311', '[lblue]':'\x0311',
'[Blue]':'\x0312', '[blue]':'\x0312',
'[Pink]':'\x0313', '[pink]':'\x0313',
'[Gray]':'\x0314', '[gray]':'\x0314',
'[lGray]':'\x0315',} '[lgray]':'\x0315',}
for x in rep: stuff['style'] = {'[b]':'\x02'}
stuff['sym'] = {'[point]':'\x07'}
final = {}
for x in stuff:
final.update(x)
for x in final:
format_string = format_string.replace(x,rep[x]) format_string = format_string.replace(x,rep[x])
return format_string return format_string