decode custom messages
This commit is contained in:
parent
88d8ef912c
commit
665af640b9
@ -705,15 +705,10 @@ class StockTicker():
|
|||||||
|
|
||||||
#displays the text entered in the webpage by the user.
|
#displays the text entered in the webpage by the user.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
f = open('csv/message_settings.json', 'r')
|
f = open('csv/message_settings.json', 'r')
|
||||||
all_settings = json.load(f)
|
all_settings = json.load(f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
colours = {'Black':(0,0,0),
|
colours = {'Black':(0,0,0),
|
||||||
'White':(255,255,255),
|
'White':(255,255,255),
|
||||||
'Red':(255,0,0),
|
'Red':(255,0,0),
|
||||||
@ -738,14 +733,14 @@ class StockTicker():
|
|||||||
elif message["size"] == 'Small':
|
elif message["size"] == 'Small':
|
||||||
font = ImageFont.load("./fonts/6x13.pil")
|
font = ImageFont.load("./fonts/6x13.pil")
|
||||||
location = (0, 7)
|
location = (0, 7)
|
||||||
|
|
||||||
|
|
||||||
r,g,b = colours[message['text_colour']]
|
r,g,b = colours[message['text_colour']]
|
||||||
|
|
||||||
background = colours[message['background_colour']]
|
background = colours[message['background_colour']]
|
||||||
|
decoded = message['text'].encode("ascii","ignore")
|
||||||
|
message['text'] = decoded.decode()
|
||||||
img = self.textImage(message['text'], font, int(r), int(g), int(b), True, w_buff = 5, background = background, location = location)
|
img = self.textImage(message['text'], font, int(r), int(g), int(b), True, w_buff = 5, background = background, location = location)
|
||||||
|
|
||||||
|
|
||||||
if all_settings['title'] and ind == 0:
|
if all_settings['title'] and ind == 0:
|
||||||
title_img = self.openImage('feature_titles/message.png')
|
title_img = self.openImage('feature_titles/message.png')
|
||||||
imgs.append(self.stitchImage([title_img, img]))
|
imgs.append(self.stitchImage([title_img, img]))
|
||||||
|
Loading…
Reference in New Issue
Block a user