fixed news logos not showing

This commit is contained in:
Justin 2022-02-28 22:01:05 +08:00 committed by GitHub
parent 62c9ae36be
commit 1bc064ce1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1394,7 +1394,7 @@ class StockTicker():
headlines = []
source_date_times = []
sources = []
source = []
@ -1421,7 +1421,7 @@ class StockTicker():
source_img = self.textImage(source_date_time, source_font, r=255, g=255, b=0, matrix_height = True)
try:
logo_name = sources.lower().replace(' ', '-')
logo_name = source.lower().replace(' ', '-')
logos_path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logos'), 'news_logos')
logo = Image.open(os.path.join(logos_path, logo_name + '.png'))
@ -1473,7 +1473,7 @@ class StockTicker():
headlines = []
source_date_times = []
sources = []
source = []
blank = Image.new('RGB', (0, 16))
@ -1503,7 +1503,7 @@ class StockTicker():
try:
logo_name = sources[i].lower().replace(' ', '-')
logo_name = source[i].lower().replace(' ', '-')
logos_path = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logos'), 'news_logos')
logo = Image.open(os.path.join(logos_path, logo_name + '.png'))