aded basic quotes

This commit is contained in:
Justin 2023-09-25 15:59:50 +08:00 committed by GitHub
parent 3e32b4c45e
commit 56c35d4bd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,19 +107,19 @@ class StockTicker():
#sys.exit()
self.points = True # display crypto change in points or percent
self.functions = {'Stocks': self.getStockImage, 'Crypto': self.getCryptoImage, 'Forex': self.getForexImage, 'Sector Performance': self.getSectorImage,
self.functions = {'Stocks': self.getStockImage, 'Crypto': self.getCryptoImage, 'Forex': self.getForexImage, 'Sector Performance': self.getSectorImage, 'Inspirational Quotes': self.getQuotesImage,
'Daily Forecast':self.getDailyWeatherImage, 'Current Weather': self.getTodayWeatherImage, 'Jokes': self.getJokesImage, 'Place (Reddit)': self.getPlaceImage,
'Sports (Team Stats)':lambda : self.getLeagueTableImage('premier_league'), 'Sports (Past Games)': lambda:self.getLeagueImage('NBA', 'past'),
'Sports (Upcoming Games)': lambda : self.getLeagueImage('NHL', 'future'), 'Sports (Live Games)': lambda: self.getLeagueImage('NBA', 'live'),
'News':self.getNewsImage, 'Custom Messages': self.getUserMessages, 'Commodities': self.getCommoditiesImage, 'Indices': self.getIndicesImage, 'Movies': self.getMoviesImage, 'Gainers, Losers, Active': self.getMarketImage,
'Economic Calendar': self.getEconomicImage, 'IPO Calendar':self.getIpoImage, 'IPO Calendar Prof':self.getIpoProfessional, 'Economic Calendar Prof': self.getEconomicProfessional, 'Gainers, Losers, Active Prof': self.getMarketProfessional,
'Stocks Prof': self.getStockProfessional, 'Crypto Prof': self.getCryptoProfessional, 'Forex Prof': self.getForexProfessional, 'Jokes Prof': self.getJokesProfessional, 'Place (Reddit) Prof': self.getPlaceImageProfessional,
'Stocks Prof': self.getStockProfessional, 'Crypto Prof': self.getCryptoProfessional, 'Forex Prof': self.getForexProfessional, 'Jokes Prof': self.getJokesProfessional, 'Place (Reddit) Prof': self.getPlaceImageProfessional, 'Inspirational Quotes Prof': self.getQuotesProfessional,
'Current Weather Prof': self.getTodayWeatherProfessional, 'News Prof':self.getNewsProfessional, 'Commodities Prof':self.getCommoditiesProfessional, 'Indices Prof': self.getIndicesProfessional, 'Sector Performance Prof': self.getSectorProfessional,
'Daily Forecast Prof':self.getDailyWeatherProfessional, 'Sports (Team Stats) Prof':lambda : self.getLeagueTableProfessional('NHL'), 'Sports (Upcoming Games) Prof': lambda : self.getLeagueProfessional('NHL', 'future'),
'Sports (Past Games) Prof': lambda : self.getLeagueProfessional('NBA', 'past'), 'Custom Messages Prof': self.getUserMessagesProfessional, 'Custom Images Prof': self.getUserImagesProfessional, 'Movies Prof': self.getMoviesProfessional, 'Sports (Live Games) Prof': lambda : self.getLeagueProfessional('NBA', 'live')}
self.JSONs = {'Stocks': 'csv/stocks_settings.json', 'Crypto': 'csv/crypto_settings.json', 'Forex': 'csv/forex_settings.json', 'Jokes': 'csv/jokes_settings.json',
self.JSONs = {'Stocks': 'csv/stocks_settings.json', 'Crypto': 'csv/crypto_settings.json', 'Forex': 'csv/forex_settings.json', 'Jokes': 'csv/jokes_settings.json', 'Inspirational Quotes': 'csv/quotes_settings.json',
'Daily Forecast':'csv/daily_weather.json', 'Current Weather': 'csv/current_weather.json', 'Commodities':'csv/commodities_settings.json', 'Indices': 'csv/indices_settings.json',
'Sports (Team Stats)': 'csv/league_tables.json', 'Sports (Past Games)': 'csv/past_games.json', 'IPO Calendar': 'csv/ipo_settings.json', 'Economic Calendar': 'csv/economic_settings.json',
'Sports (Upcoming Games)': 'csv/upcoming_games.json', 'Sports (Live Games)': 'csv/live_games.json', 'Movies': 'csv/movie_settings.json', 'Clock 1': 'csv/clock1_settings.json', 'Clock 2': 'csv/clock2_settings.json', 'World Clock': 'csv/worldclock_settings.json',
@ -7729,6 +7729,36 @@ class StockTicker():
return self.stitchImage(image_list)
def getQuotesImage(self):
f = open('csv/quotes_settings.json', 'r')
quotes_settings = json.load(f)
f.close()
if quotes_settings['title']:
title_img = self.openImage('feature_titles/quotes.png')
image_list = [title_img]
else:
image_list = []
return self.stitchImage(image_list)
def getQuotesProfessional(self):
f = open('csv/quotes_settings.json', 'r')
quotes_settings = json.load(f)
f.close()
if quotes_settings['title']:
title_img = self.openImage('feature_titles/small_feature_titles/quotes.png')
image_list = [title_img]
else:
image_list = []
return self.stitchImage(image_list)
def getMarketImage(self):
f = open('csv/market_settings.json', 'r')
market_settings = json.load(f)
@ -9764,6 +9794,7 @@ class StockTicker():
market = self.getMarketProfessional()
sector = self.getSectorProfessional()
place = self.getPlaceImageProfessional()
quotes = self.getQuotesProfessional()
x_offset = 0
news.paste(weather, (x_offset, 16))
@ -9806,6 +9837,8 @@ class StockTicker():
x_offset += sector.size[0]
news.paste(place, (x_offset, 16))
x_offset += place.size[0]
news.paste(quotes, (x_offset, 16))
x_offset += quotes.size[0]
self.double_buffer = self.matrix.CreateFrameCanvas()
while True:
kill = stock_ticker.scrollImage(news, offset_x = 128)
@ -9913,6 +9946,9 @@ class StockTicker():
elif msg == 'WCL':
self.scrollFunctionsAnimated(['worldclock', 'worldclock'],animation = 'traditional')
elif msg == 'IQ':
self.scrollFunctionsAnimated(['quotes', 'quotes'],animation = 'traditional')
elif msg == 'A': #everything