bug fixes

This commit is contained in:
Neythen 2021-07-08 17:48:03 +01:00
parent d87d703596
commit 2e825e3174
22 changed files with 59 additions and 101 deletions

View File

@ -228,7 +228,7 @@ def updateStockPrices():
logf.write('. type: ' + str(exc_type))
logf.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
sys.exit()
def updateCrypto():
@ -575,7 +575,7 @@ def checkStocks(last_update, update_frequency):
if last_update < yday_closing:
updated = True
updateStockPrices(symbols)
updateStockPrices()
return updated
@ -600,7 +600,7 @@ if __name__ == '__main__':
newsapi = NewsApiClient(api_key='cf08652bd17647b89aaf469a1a8198a9')
update_frequencies = {'stocks':2, 'crypto':10, 'news':120, 'weather': 10, 'sports': 120} #minutes
update_frequencies = {'stocks':2, 'crypto':10, 'news':120, 'weather': 120, 'sports': 120} #minutes
NY_zone = pytz.timezone('America/New_York')
CET_zone = pytz.timezone('Europe/Berlin')

View File

@ -1,4 +1,4 @@
symbol,name,base,current,24hr change
BTC,bitcoin,usd,33900,-0.8918953711475721
ETH,ethereum,gbp,1679.65,3.4282607943042347
DOGE,dogecoin,usd,0.230969,-1.3970219999749205
BTC,bitcoin,usd,32879,-5.238673432165651
ETH,ethereum,gbp,1571.61,-8.363422384968763
DOGE,dogecoin,usd,0.212173,-8.688991749540397

1 symbol name base current 24hr change
2 BTC bitcoin usd 33900 32879 -0.8918953711475721 -5.238673432165651
3 ETH ethereum gbp 1679.65 1571.61 3.4282607943042347 -8.363422384968763
4 DOGE dogecoin usd 0.230969 0.212173 -1.3970219999749205 -8.688991749540397

View File

@ -1 +1 @@
["USD", {"AUD": [1.3206, 1.3282], "CAD": [1.2367, 1.2362], "CHF": [0.9233, 0.92154], "EUR": [0.84474, 0.84274], "GBP": [0.72183, 0.72194], "JPY": [110.65, 110.89], "NZD": [1.411, 1.4243]}]
["USD", {"AUD": [1.3479, 1.328], "CAD": [1.2581, 1.2432], "CHF": [0.91662, 0.92275], "EUR": [0.84474, 0.84524], "GBP": [0.7276, 0.72268], "JPY": [109.74, 110.61], "NZD": [1.4401, 1.4166]}]

View File

@ -1 +1 @@
[{"main_weather": "Clouds", "description": "broken clouds", "temp": 27.94, "min_temp": 27.68, "max_temp": 28.73, "feels_like": 33.73, "humidity": 91, "clouds": 72, "wind_speed": 4.47, "wind_direction": 110, "visibility": 10000, "uv": 0, "rain_chance": 0.64}, {"main_weather": "Clouds", "description": "overcast clouds", "temp": 15.73, "min_temp": 12.66, "max_temp": 18.47, "feels_like": 15.47, "humidity": 81, "clouds": 95, "wind_speed": 6.17, "wind_direction": 220, "visibility": 10000, "uv": 0.19, "rain_chance": 0.26}]
[{"main_weather": "Clear", "description": "clear sky", "temp": 28.76, "min_temp": 27.5, "max_temp": 29.88, "feels_like": 34.7, "humidity": 83, "clouds": 6, "wind_speed": 0.45, "wind_direction": 302, "visibility": 10000, "uv": 0, "rain_chance": 0}, {"main_weather": "Clouds", "description": "few clouds", "temp": 19.67, "min_temp": 12.56, "max_temp": 21.29, "feels_like": 19.65, "humidity": 75, "clouds": 20, "wind_speed": 4.12, "wind_direction": 220, "visibility": 10000, "uv": 1.21, "rain_chance": 0.82}]

View File

@ -1 +1 @@
[[{"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.68, "max_temp": 28.73}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.24, "max_temp": 29.6}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.62, "max_temp": 29.69}, {"main_weather": "Clouds", "description": "broken clouds", "min_temp": 27.46, "max_temp": 29.53}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.85, "max_temp": 29.76}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.87, "max_temp": 29.59}, {"main_weather": "Clouds", "description": "scattered clouds", "min_temp": 27.6, "max_temp": 29.63}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 27.71, "max_temp": 29.57}], [{"main_weather": "Rain", "description": "moderate rain", "min_temp": 12.66, "max_temp": 18.47}, {"main_weather": "Rain", "description": "light rain", "min_temp": 12.87, "max_temp": 19.55}, {"main_weather": "Rain", "description": "light rain", "min_temp": 12.64, "max_temp": 21.63}, {"main_weather": "Clouds", "description": "scattered clouds", "min_temp": 14.24, "max_temp": 23.25}, {"main_weather": "Rain", "description": "light rain", "min_temp": 14.32, "max_temp": 20.42}, {"main_weather": "Rain", "description": "light rain", "min_temp": 13.78, "max_temp": 18.6}, {"main_weather": "Rain", "description": "light rain", "min_temp": 12.95, "max_temp": 17.28}, {"main_weather": "Rain", "description": "light rain", "min_temp": 11.05, "max_temp": 21.53}]]
[[{"main_weather": "Clear", "description": "clear sky", "min_temp": 27.5, "max_temp": 29.88}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.19, "max_temp": 29.67}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.74, "max_temp": 29.76}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.93, "max_temp": 29.66}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.79, "max_temp": 29.39}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.85, "max_temp": 29.43}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.77, "max_temp": 29.71}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.58, "max_temp": 29.86}], [{"main_weather": "Rain", "description": "light rain", "min_temp": 12.56, "max_temp": 21.29}, {"main_weather": "Clouds", "description": "scattered clouds", "min_temp": 13.75, "max_temp": 22.24}, {"main_weather": "Rain", "description": "light rain", "min_temp": 13.6, "max_temp": 16.97}, {"main_weather": "Rain", "description": "light rain", "min_temp": 12.32, "max_temp": 20.09}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 14.42, "max_temp": 16.14}, {"main_weather": "Rain", "description": "light rain", "min_temp": 12.53, "max_temp": 21.98}, {"main_weather": "Rain", "description": "light rain", "min_temp": 14.85, "max_temp": 17.18}, {"main_weather": "Clouds", "description": "few clouds", "min_temp": 13.16, "max_temp": 20.6}]]

View File

@ -1 +0,0 @@
{"stocks": "06/07/2021 15:14:18", "crypto": "06/07/2021 15:14:18", "news": "06/07/2021 15:14:20", "weather": "06/07/2021 15:14:19", "forex": "06/07/2021 21:14:23", "sports": "06/07/2021 15:14:21"}

View File

@ -1,21 +1,21 @@
headline,source,date,time
Long Covid campaigners urge Sajid Javid to reconsider timing of restriction lifting - The Independent,Independent,2021-07-06,18:36:30Z
Italy vs. Spain: UEFA Euro 2020 live stream^ TV channel^ how to watch semifinal online^ news^ odds^ time - CBS Sports,CBS Sports,2021-07-06,18:32:00Z
Heart health: Sureshot ways to prevent a heart attack right now^ as per experts - Times of India,The Times of India,2021-07-06,18:30:00Z
Tuck into this breathtaking SA dino breakthrough - TimesLIVE,TimesLIVE,2021-07-06,18:17:00Z
Steven Gallant: Inmate who tackled Fishmongers' Hall attacker to be released from prison - Sky News,Sky.com,2021-07-06,18:09:05Z
Uncertainty surrounds Zambias Kaunda funeral as family contests burial site - Punch Newspapers,The Punch,2021-07-06,17:59:49Z
Giannis Antetokounmpo knee injury: Bucks star upgraded to questionable for NBA Finals Game 1 vs. Suns - CBS Sports,CBS Sports,2021-07-06,17:54:00Z
Girls' Generation's Taeyeon relaxes in 'Weekend' music video - UPI News,UPI.com,2021-07-06,17:52:35Z
Manitoba tops vaccine milestone tied to next phase of reopenings - CBC.ca,CBC News,2021-07-06,17:52:05Z
Astronomers Spot a Batch of Rogue Planets Near the Galactic Core - Gizmodo,Gizmodo.com,2021-07-06,17:50:00Z
DOD cancels $10 billion JEDI contract at center of Microsoft and Amazon feud - Engadget,Engadget,2021-07-06,17:48:45Z
Italy vs Spain^ Euro 2020 LIVE: Line-ups^ team news and latest updates - MARCA.com,Marca,2021-07-06,17:45:17Z
Eswatini turmoil: Sanef pleads with Ramaphosa to mobilise SADC leaders following attack on journalists - News24,News24,2021-07-06,17:44:49Z
Tragic mum dies after becoming trapped in charity bin while looking for clothes - The Mirror,Mirror Online,2021-07-06,17:41:37Z
Under fire over activist Stan Swamys death^ govt says detention was in accordance with law - The Indian Express,The Indian Express,2021-07-06,17:41:25Z
Taliban Try to Polish Their Image as They Push for Victory - The New York Times,New York Times,2021-07-06,17:40:38Z
Italy XI vs Spain: Starting lineup^ latest team news^ squad^ injury update for Euros semi-final today - Evening Standard,Evening Standard,2021-07-06,17:40:07Z
Civil engineer claims he was defamed by newspaper in court report about uninsured driver with the same name - Independent.ie,Independent.ie,2021-07-06,17:38:00Z
Covid 19 coronavirus: Fiji records six deaths^ 636 new cases in 24 hours - New Zealand Herald,New Zealand Herald,2021-07-06,17:32:29Z
Former Ulster Bank CEO Cormac McCarthy dies suddenly aged 58 - The Irish Times,The Irish Times,2021-07-06,17:27:04Z
Why I'm Confident Nnamdi Kanu Will Soon Be Released—IPOB Leader's Lawyer - SaharaReporters.com,Saharareporters.com,2021-07-08,14:35:35Z
Tokyo Olympics will be held without spectators^ under a state of emergency - Stuff.co.nz,Stuff.co.nz,2021-07-08,14:34:00Z
Venus^ Mars and crescent moon to align in 'planetary conjunction' during 12-13 July - Firstpost,Firstpost,2021-07-08,14:27:07Z
Death toll in Surfside building collapse rises to 60 after search efforts turn from rescue to recovery - CNN ,CNN,2021-07-08,14:25:00Z
DOF to WB: Recall 'outdated report' on PHL education | Bernadette D. Nicolas and Cai Ordinario - Business Mirror,Businessmirror.com.ph,2021-07-08,14:24:42Z
Huge leap for NASAs Mars helicopter ushers new mission support role - The Verge,The Verge,2021-07-08,14:23:02Z
Human body size shaped by climate^ evolutionary study shows - The Guardian,The Guardian,2021-07-08,14:23:00Z
Spectators banned from Tokyo Olympic Games - CBC.ca,CBC News,2021-07-08,14:21:56Z
Study Analyzes the Impact of Atmospheric Acidity on Ocean Ecology - AZoCleantech,AZoCleantech,2021-07-08,14:16:00Z
Stellantis makes 30 billion euro wager on electric vehicle market - Reuters,Reuters,2021-07-08,14:10:00Z
Over half of Ontario adults fully vaccinated against COVID-19; province to receive 5 million more doses in July - CP24 Toronto's Breaking News,CP24 Toronto's Breaking News,2021-07-08,14:06:03Z
Transfer news: Fabrizio Romano confirms Arsenal signing is "really imminent" - GIVEMESPORT,GIVEMESPORT,2021-07-08,14:00:00Z
Japan: Olympics to take place without spectators as state of emergency declared - The Irish Times,The Irish Times,2021-07-08,13:56:57Z
Ram Teases Electric 1500 Pickup Truck Coming In 2024 - InsideEVs ,InsideEVs ,2021-07-08,13:49:00Z
First meeting of PM Modi's new Cabinet focusses on agriculture^ health sectors - Times of India,The Times of India,2021-07-08,13:45:00Z
Animal lovers up in arms after abuse of two-month-old puppy - The Star Online,The Star Online,2021-07-08,13:45:00Z
South Africa's MeerKAT discovers treasure trove of galaxies - TechCentral,TechCentral,2021-07-08,13:43:28Z
Delta variant growth likely to outmatch vaccine supply in coming weeks Reid - The Irish Times,The Irish Times,2021-07-08,13:43:02Z
Singapore's largest E-sports Experience Centre opens at Kallang Wave Mall - The Straits Times,The Straits Times,2021-07-08,13:42:55Z
Naya Rivera: A look back at the events leading to the star's tragic death - Fox News,Fox News,2021-07-08,13:41:33Z

Can't render this file because it contains an unexpected character in line 13 and column 60.

View File

@ -1,2 +1,2 @@
speed,brightness
f,9
m,9
1 speed brightness
2 f m 9

View File

@ -1 +1 @@
[{"date": "2021-07-06", "time": "00:00:00", "round": "0", "home_team": "Montreal Canadiens", "home_score": "3", "away_team": "Tampa Bay Lightning", "away_score": "2"}, {"date": "2021-07-08", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": null, "away_team": "Montreal Canadiens", "away_score": null}]
[{"date": "2021-07-08", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "1", "away_team": "Montreal Canadiens", "away_score": "0"}]

View File

@ -1 +1 @@
[{"date": "2021-07-06", "time": "00:00", "progess": "", "status": "AOT", "home_team": "Montreal Canadiens", "home_score": "3", "away_team": "Tampa Bay Lightning", "away_score": "2"}]
[{"date": "2021-07-08", "time": "00:00", "progess": "", "status": "FT", "home_team": "Tampa Bay Lightning", "home_score": "1", "away_team": "Montreal Canadiens", "away_score": "0"}]

View File

@ -1 +1 @@
[{"date": "2021-07-03", "time": "00:00:00", "round": "0", "home_team": "Montreal Canadiens", "home_score": "3", "away_team": "Tampa Bay Lightning", "away_score": "6"}, {"date": "2021-07-01", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "3", "away_team": "Montreal Canadiens", "away_score": "1"}, {"date": "2021-06-29", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "5", "away_team": "Montreal Canadiens", "away_score": "1"}, {"date": "2021-06-26", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "1", "away_team": "New York Islanders", "away_score": "0"}, {"date": "2021-06-25", "time": "00:00:00", "round": "0", "home_team": "Montreal Canadiens", "home_score": "3", "away_team": "Vegas Golden Knights", "away_score": "2"}, {"date": "2021-06-24", "time": "00:00:00", "round": "0", "home_team": "New York Islanders", "home_score": "3", "away_team": "Tampa Bay Lightning", "away_score": "2"}, {"date": "2021-06-23", "time": "01:00:00", "round": "0", "home_team": "Vegas Golden Knights", "home_score": "1", "away_team": "Montreal Canadiens", "away_score": "4"}, {"date": "2021-06-22", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "8", "away_team": "New York Islanders", "away_score": "0"}, {"date": "2021-06-21", "time": "00:00:00", "round": "0", "home_team": "Montreal Canadiens", "home_score": "1", "away_team": "Vegas Golden Knights", "away_score": "2"}, {"date": "2021-06-20", "time": "00:00:00", "round": "0", "home_team": "New York Islanders", "home_score": "3", "away_team": "Tampa Bay Lightning", "away_score": "2"}, {"date": "2021-06-19", "time": "00:00:00", "round": "0", "home_team": "Montreal Canadiens", "home_score": "3", "away_team": "Vegas Golden Knights", "away_score": "2"}, {"date": "2021-06-18", "time": "00:00:00", "round": "0", "home_team": "New York Islanders", "home_score": "1", "away_team": "Tampa Bay Lightning", "away_score": "2"}, {"date": "2021-06-17", "time": "01:00:00", "round": "0", "home_team": "Vegas Golden Knights", "home_score": "2", "away_team": "Montreal Canadiens", "away_score": "3"}, {"date": "2021-06-16", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "4", "away_team": "New York Islanders", "away_score": "2"}, {"date": "2021-06-15", "time": "01:00:00", "round": "0", "home_team": "Vegas Golden Knights", "home_score": "4", "away_team": "Montreal Canadiens", "away_score": "1"}]
[{"date": "2021-07-06", "time": "00:00:00", "round": "0", "home_team": "Montreal Canadiens", "home_score": "3", "away_team": "Tampa Bay Lightning", "away_score": "2"}, {"date": "2021-07-03", "time": "00:00:00", "round": "0", "home_team": "Montreal Canadiens", "home_score": "3", "away_team": "Tampa Bay Lightning", "away_score": "6"}, {"date": "2021-07-01", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "3", "away_team": "Montreal Canadiens", "away_score": "1"}, {"date": "2021-06-29", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "5", "away_team": "Montreal Canadiens", "away_score": "1"}, {"date": "2021-06-26", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "1", "away_team": "New York Islanders", "away_score": "0"}, {"date": "2021-06-25", "time": "00:00:00", "round": "0", "home_team": "Montreal Canadiens", "home_score": "3", "away_team": "Vegas Golden Knights", "away_score": "2"}, {"date": "2021-06-24", "time": "00:00:00", "round": "0", "home_team": "New York Islanders", "home_score": "3", "away_team": "Tampa Bay Lightning", "away_score": "2"}, {"date": "2021-06-23", "time": "01:00:00", "round": "0", "home_team": "Vegas Golden Knights", "home_score": "1", "away_team": "Montreal Canadiens", "away_score": "4"}, {"date": "2021-06-22", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "8", "away_team": "New York Islanders", "away_score": "0"}, {"date": "2021-06-21", "time": "00:00:00", "round": "0", "home_team": "Montreal Canadiens", "home_score": "1", "away_team": "Vegas Golden Knights", "away_score": "2"}, {"date": "2021-06-20", "time": "00:00:00", "round": "0", "home_team": "New York Islanders", "home_score": "3", "away_team": "Tampa Bay Lightning", "away_score": "2"}, {"date": "2021-06-19", "time": "00:00:00", "round": "0", "home_team": "Montreal Canadiens", "home_score": "3", "away_team": "Vegas Golden Knights", "away_score": "2"}, {"date": "2021-06-18", "time": "00:00:00", "round": "0", "home_team": "New York Islanders", "home_score": "1", "away_team": "Tampa Bay Lightning", "away_score": "2"}, {"date": "2021-06-17", "time": "01:00:00", "round": "0", "home_team": "Vegas Golden Knights", "home_score": "2", "away_team": "Montreal Canadiens", "away_score": "3"}, {"date": "2021-06-16", "time": "00:00:00", "round": "0", "home_team": "Tampa Bay Lightning", "home_score": "4", "away_team": "New York Islanders", "away_score": "2"}]

View File

@ -1,4 +1,4 @@
name,current,opening
MSFT,277.355,278.02
NFLX,542.15,532.56
GOOG,2595.72,2588.01
MSFT,277.26,276.9
NFLX,531.78,531.17
GOOG,2594.34,2564.005

1 name current opening
2 MSFT 277.355 277.26 278.02 276.9
3 NFLX 542.15 531.78 532.56 531.17
4 GOOG 2595.72 2594.34 2588.01 2564.005

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -284,7 +284,7 @@ def matrix():
elif "Run Forex" in request.form:
ticker.sendline('K')
ticker.sendline('f')
ticker.sendline('F')
elif "Run News" in request.form:
@ -308,7 +308,7 @@ def matrix():
elif "Future NHL" in request.form:
ticker.sendline('K')
ticker.sendline('F')
ticker.sendline('l')
elif "Live NHL" in request.form:
ticker.sendline('K')

View File

@ -1132,7 +1132,7 @@ class StockTicker():
small_font = ImageFont.load("./fonts/5x7.pil")
large_font = ImageFont.load("./fonts/10x20.pil")
location_img = self.textImage(location, small_font, r = 255, g = 255, b = 0)
location_img = self.textImage(location.upper(), small_font, r = 255, g = 255, b = 0)
img.paste(location_img, (5,0))
@ -1156,10 +1156,10 @@ class StockTicker():
img.paste(deg_img, (56, 8))
main = current_weather['main_weather']
main_img = self.textImage(main, small_font)
main_img = self.textImage(main.upper(), small_font)
img.paste(main_img, (34, 26))
feels_img = self.textImage('Feels like:' + str("{0:.0f}".format(current_weather['feels_like'])), small_font)
feels_img = self.textImage('Feels like:'.upper() + str("{0:.0f}".format(current_weather['feels_like'])), small_font)
img.paste(feels_img, (location_img.size[0] + 10, 0))
min_img = self.textImage( "{0:.0f}".format(current_weather['min_temp']), small_font, r=0, g=0, b=255)
@ -1187,7 +1187,7 @@ class StockTicker():
weekday = weekdays[datetime.today().weekday()]
date_img = self.textImage(month + ' ' + date + ',' + weekday, small_font)
date_img = self.textImage((month + ' ' + date + ',' + weekday).upper(), small_font)
img.paste(date_img, (132, 0))
rain_img = Image.open(weather_dir + '/rain-chance.png')
@ -1209,7 +1209,7 @@ class StockTicker():
wtext_img = self.textImage("{0:.0f}".format(current_weather['wind_speed']) + 'm/s', small_font)
img.paste(wtext_img, (168, 10))
wdir_img = self.textImage(self.degreesToCompass(current_weather['wind_direction']), small_font)
wdir_img = self.textImage(self.degreesToCompass(current_weather['wind_direction']).upper(), small_font)
img.paste(wdir_img, (183, 10))
vis_img = Image.open(weather_dir + '/visibility.png')
@ -1392,7 +1392,7 @@ class StockTicker():
large_font = ImageFont.load("./fonts/10x20.pil")
location_img = self.textImage(location, extra_small_font, r = 255, g = 255, b = 0)
location_img = self.textImage(location.upper(), extra_small_font, r = 255, g = 255, b = 0)
@ -1420,7 +1420,7 @@ class StockTicker():
main = current_weather['main_weather']
main_img = self.textImage(main, small_font)
main_img = self.textImage(main.upper(), small_font)
weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
months =['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
@ -1429,7 +1429,7 @@ class StockTicker():
weekday = weekdays[datetime.today().weekday()]
date_img = self.textImage(month + ' ' + date + ',' + weekday, extra_small_font)
date_img = self.textImage((month + ' ' + date + ',' + weekday).upper(), extra_small_font)
rain_img = Image.open(weather_dir + '/rain-chance.png')
@ -1528,7 +1528,7 @@ class StockTicker():
weekday = weekdays[(datetime.today().weekday() + i)%7]
day_img = self.textImage( weekday, small_font)
day_img = self.textImage( weekday.upper(), small_font)
weather = daily_weather[i]
main = weather['main_weather']
@ -1668,35 +1668,16 @@ class StockTicker():
def process_msg(self, msg):
if msg == 'S': # stocks
img = self.getStockImage()
#img = self.getStockProfessional()
img.save('display_images/stocks.ppm')
self.scrollImageTransition(['display_images/stocks.ppm', 'display_images/stocks.ppm'], stocks = False)
self.scrollFunctionsAnimated(['stocks', 'stocks'], animation = 'continuous')
elif msg == 'C': # crypto
img = self.getCryptoImage()
#img = self.getStockProfessional()
img.save('display_images/crypto.ppm')
self.scrollImageTransition(['display_images/crypto.ppm', 'display_images/crypto.ppm'], stocks = False)
self.scrollFunctionsAnimated(['crypto', 'crypto'], animation = 'continuous')
elif msg == 'f': # stocks
img = self.getForexImage()
#img = self.getStockProfessional()
img.save('display_images/forex.ppm')
self.scrollImageTransition(['display_images/forex.ppm', 'display_images/forex.ppm'], stocks = False)
elif msg == 'F': # forex
self.scrollFunctionsAnimated(['forex', 'forex'], animation = 'continuous')
elif msg == 'N': #news
img = self.getNewsImage()
img.save('display_images/news.ppm')
self.scrollImageTransition(['display_images/news.ppm', 'display_images/news.ppm'], stocks = False)
self.scrollFunctionsAnimated(['news', 'news'], animation = 'continuous')
# speed settings
elif msg == 's':
@ -1716,42 +1697,20 @@ class StockTicker():
elif msg == 'T':# text
img = self.getUserText()
img.save('display_images/scroll_text.ppm')
self.scrollImageTransition(['display_images/scroll_text.ppm', 'display_images/scroll_text.ppm'], offset_x = 128, offset_y = 0, stocks = False)
self.scrollFunctionsAnimated(['text', 'text'], animation = 'continuous')
elif msg == 'I': # image
image = self.openImage(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'display_images/user_image.ppm'))
#self.setImage( image)
while True:
kill = self.scrollImage(image, offset_x = 128)
if kill:
break
self.scrollFunctionsAnimated(['display_image', 'display_image'], animation = 'continuous')
elif msg == 'G': # gif
gif = Image.open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'display_images/user_gif.ppm'))
#self.displayGIF(gif)
while True:
kill = self.scrollGIF(gif, offset_x = 128)
if kill:
break
self.scrollFunctionsAnimated(['display_gif', 'display_gif'], animation = 'continuous')
elif msg == 'W': # weather
img = self.getTodayWeatherImage()
img.save('display_images/weather.ppm')
self.scrollImageTransition(['display_images/weather.ppm', 'display_images/today_weather.ppm'], stocks = False)
self.scrollFunctionsAnimated(['today_weather', 'today_weather'], animation = 'continuous')
elif msg == 'D': # daily weather
#self.displayDailyWeatherAlt()
img = self.getDailyWeatherImage()
img.save('display_images/weather.ppm')
#self.setImage( image)
self.scrollImageTransition(['display_images/weather.ppm', 'display_images/daily_weather.ppm'], stocks = False)
self.scrollFunctionsAnimated(['daily_weather', 'daily_weather'], animation = 'continuous')
elif msg == 'P': # past league
img = self.getLeagueImage('NBA', 'past')
@ -1759,7 +1718,7 @@ class StockTicker():
stock_ticker.scrollImageTransition(['display_images/league.ppm', 'display_images/league.ppm'], stocks = False)
elif msg == 'F': # future league
elif msg == 'l': # future league
img = self.getLeagueImage('NHL', 'future')
img.save('display_images/league.ppm')
@ -1813,7 +1772,7 @@ if __name__ == '__main__':
#stock_ticker.process_msg('N')
#stock_ticker.process_msg('G')
#stock_ticker.process_msg('f')
#stock_ticker.process_msg('A')
#stock_ticker.process_msg('W')