bug fix
This commit is contained in:
parent
23772b673f
commit
ba359d5a49
@ -1,4 +1,4 @@
|
||||
symbol,name,base,current,24hr change
|
||||
BTC,bitcoin,usd,40481,6.539539468799979
|
||||
ETH,ethereum,gbp,1673.43,3.6836171276675143
|
||||
DOGE,dogecoin,usd,0.208859,3.8108243554073558
|
||||
BTC,bitcoin,usd,39922,0.9790721483287458
|
||||
ETH,ethereum,gbp,1657.59,1.6736883847772048
|
||||
DOGE,dogecoin,usd,0.208642,1.838353355241577
|
||||
|
|
@ -1 +1 @@
|
||||
[{"main_weather": "Clouds", "description": "overcast clouds", "temp": 28.86, "min_temp": 27.95, "max_temp": 28.93, "feels_like": 35.43, "humidity": 85, "clouds": 100, "wind_speed": 1.79, "wind_direction": 250, "visibility": 10000, "uv": 0, "rain_chance": 1}, {"main_weather": "Clouds", "description": "broken clouds", "temp": 15.9, "min_temp": 14.99, "max_temp": 20.24, "feels_like": 15.84, "humidity": 88, "clouds": 75, "wind_speed": 5.66, "wind_direction": 230, "visibility": 10000, "uv": 0.11, "rain_chance": 0.36}]
|
||||
[{"main_weather": "Clouds", "description": "overcast clouds", "temp": 29.14, "min_temp": 28.1, "max_temp": 29.92, "feels_like": 36.14, "humidity": 90, "clouds": 96, "wind_speed": 0.45, "wind_direction": 90, "visibility": 10000, "uv": 0, "rain_chance": 0}, {"main_weather": "Clouds", "description": "scattered clouds", "temp": 21.34, "min_temp": 12.35, "max_temp": 21.56, "feels_like": 20.91, "humidity": 53, "clouds": 28, "wind_speed": 6.69, "wind_direction": 260, "visibility": 10000, "uv": 2.93, "rain_chance": 0}]
|
@ -1 +1 @@
|
||||
[[{"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.95, "max_temp": 28.93}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.31, "max_temp": 30.17}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.75, "max_temp": 30.23}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.19, "max_temp": 29.81}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.92, "max_temp": 30.34}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.29, "max_temp": 32.23}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.76, "max_temp": 31.19}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.3, "max_temp": 30.35}], [{"main_weather": "Rain", "description": "moderate rain", "min_temp": 14.99, "max_temp": 20.24}, {"main_weather": "Clouds", "description": "scattered clouds", "min_temp": 12.5, "max_temp": 21.96}, {"main_weather": "Rain", "description": "light rain", "min_temp": 14.53, "max_temp": 18.18}, {"main_weather": "Rain", "description": "light rain", "min_temp": 13.82, "max_temp": 20.65}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 14.28, "max_temp": 21.29}, {"main_weather": "Rain", "description": "light rain", "min_temp": 14.14, "max_temp": 18.75}, {"main_weather": "Rain", "description": "light rain", "min_temp": 12.07, "max_temp": 20.58}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 13.73, "max_temp": 18.4}]]
|
||||
[[{"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.1, "max_temp": 29.92}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.42, "max_temp": 29.19}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.53, "max_temp": 30.07}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.35, "max_temp": 29.88}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.43, "max_temp": 28.64}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.31, "max_temp": 29.18}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.32, "max_temp": 31.55}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.18, "max_temp": 32.05}], [{"main_weather": "Clouds", "description": "scattered clouds", "min_temp": 12.35, "max_temp": 21.56}, {"main_weather": "Rain", "description": "light rain", "min_temp": 14.31, "max_temp": 18.5}, {"main_weather": "Rain", "description": "light rain", "min_temp": 14.38, "max_temp": 20.87}, {"main_weather": "Rain", "description": "light rain", "min_temp": 13.75, "max_temp": 20.42}, {"main_weather": "Rain", "description": "light rain", "min_temp": 13.39, "max_temp": 20.32}, {"main_weather": "Rain", "description": "light rain", "min_temp": 15.16, "max_temp": 21.32}, {"main_weather": "Rain", "description": "light rain", "min_temp": 13.99, "max_temp": 21.43}, {"main_weather": "Rain", "description": "light rain", "min_temp": 14.34, "max_temp": 21.38}]]
|
@ -0,0 +1 @@
|
||||
{"stocks": "29/07/2021 09:47:45", "crypto": "29/07/2021 09:47:48", "news": "29/07/2021 09:25:32", "weather": "29/07/2021 09:25:31", "forex": "29/07/2021 15:25:35", "sports": "29/07/2021 09:25:33"}
|
40
csv/news.csv
40
csv/news.csv
@ -1,21 +1,21 @@
|
||||
headline,source,date,time
|
||||
Stock Market Highlights: Sensex falls 135 points^ Nifty ends below 15^750 dragged by financials - CNBCTV18,CNBCTV18,2021-07-28,18:26:00Z
|
||||
Duterte not worried about persons already vaccinated against COVID-19 going out - INQUIRER.net,Inquirer.net,2021-07-28,18:19:00Z
|
||||
‘890 million-year-old sponge fossils’ could be earliest animal life - thejournal.ie,TheJournal.ie,2021-07-28,18:14:00Z
|
||||
Efficacy of Pfizer/BioNTech Covid vaccine slips to 84% after six months^ data show - STAT,STAT,2021-07-28,18:03:22Z
|
||||
Midtjylland 0 Celtic 0 LIVE score as Liel Abada once again shows his class - Scottish Daily Record,Daily Record,2021-07-28,17:57:13Z
|
||||
'We failed': Molson apologizes to fans^ but Habs stick by Mailloux - Montreal Gazette,Montreal Gazette,2021-07-28,17:48:45Z
|
||||
Blood clots in severe COVID-19 patients may be related to abnormal antibody response: Study - Times Now,Zoom,2021-07-28,17:40:00Z
|
||||
WATCH | EFF in tense stand-off with Pretoria residents^ Afrikaner group at old age home - News24,News24,2021-07-28,17:32:38Z
|
||||
Further easing of Covid-19 measures ‘may not be far away’^ says Holohan - The Irish Times,The Irish Times,2021-07-28,17:30:29Z
|
||||
Physical Activity^ Less TV Watching Associated With Lower Risk of Obstructive Sleep Apnea - AJMC.com Managed Markets Network,Ajmc.com,2021-07-28,17:29:51Z
|
||||
890-million-year-old sponge structures found in Canada may be Earth's oldest animal life - News24,News24,2021-07-28,17:27:52Z
|
||||
Metro Manila^ nearby provinces remain under GCQ with heightened restrictions - ABS-CBN News,Abs-cbn.com,2021-07-28,17:23:00Z
|
||||
Former high-ranking Nxivm member who testified against Keith Raniere will not go to prison - CNN,CNN,2021-07-28,17:23:00Z
|
||||
Elise Stefanik Calls Liz Cheney a 'Pelosi Pawn' - Fox News,Fox News,2021-07-28,17:19:36Z
|
||||
Teacher in Camarines Sur invents disinfecting machine for school papers - GMA News Online,GMA News,2021-07-28,17:18:33Z
|
||||
Bryan Cranston says Bob Odenkirk is 'receiving the medical attention he needs' after collapsing on set - Fox News,Fox News,2021-07-28,17:17:12Z
|
||||
Coronavirus Delta variant pushing Tokyo's health system to the brink as city hosts Olympics - ABC News,ABC News (AU),2021-07-28,17:10:44Z
|
||||
UPDATED: Court frees El-Zakzaky^ wife Zeenat - Punch Newspapers,The Punch,2021-07-28,17:01:17Z
|
||||
NZ Post buys a share of parcel processing firm^ putting another 130 jobs on the line - Stuff.co.nz,Stuff.co.nz,2021-07-28,17:00:00Z
|
||||
Tokyo Olympics: It's 'payback' for Black Ferns sevens after Rio heartbreak against Australia - Stuff.co.nz,Stuff.co.nz,2021-07-28,17:00:00Z
|
||||
Audi A3 ushers in bolder styling and more tech - Business Day,Business Day,2021-07-29,12:35:41Z
|
||||
My COVID story: 'My dad was fully vaccinated and I still lost him to COVID' - Times of India,The Times of India,2021-07-29,12:33:00Z
|
||||
PM Modi on NEP 2020 LIVE Updates: ‘Indian sign language to be introduced as subject at secondary level’ - The Indian Express,The Indian Express,2021-07-29,12:14:12Z
|
||||
Apple says chip shortage reaches iPhone^ growth forecast slows - Global Times,Global Times,2021-07-29,12:03:00Z
|
||||
Tracking NASA's Mars Perseverance rover^ a year in - CNET,CNET,2021-07-29,12:00:16Z
|
||||
A molecular map reveals the development of each cell in the brain - Tech Explorist,Tech Explorist,2021-07-29,11:58:39Z
|
||||
Cummings directed government to use taxpayers’ money to do political polling on Starmer^ emails reveal - The Independent,Independent,2021-07-29,11:57:06Z
|
||||
PS5 software update beta includes 3D audio for TV speakers and more - Gamesradar,GamesRadar+,2021-07-29,11:56:14Z
|
||||
Olympics: No medal as S'pore's Yu Mengyu loses in table tennis bronze-medal play-off - The Straits Times,The Straits Times,2021-07-29,11:51:53Z
|
||||
PMO: Emergency Ordinances revocation done in accordance to Federal Constitution^ law - The Star Online,The Star Online,2021-07-29,11:48:00Z
|
||||
Novak Djokovic weighs in on Naomi Osaka^ Simone Biles Olympic drama - Yahoo Sport Australia,Yahoo Entertainment,2021-07-29,11:46:26Z
|
||||
South Africa v British & Irish Lions: Rassie Erasmus complains about refereeing in video monologue - BBC Sport,BBC News,2021-07-29,11:44:43Z
|
||||
Google employees 'will need to be vaccinated' before returning to offices - TheJournal.ie,TheJournal.ie,2021-07-29,11:40:00Z
|
||||
23 Members Of Prashant Kishor's Firm^ On Visit To Tripura^ Get Bail - NDTV,NDTV News,2021-07-29,11:38:19Z
|
||||
Mandatory Covid-19 testing for residents of 2 HDB blocks in Choa Chu Kang and Jurong West - The Straits Times,The Straits Times,2021-07-29,11:38:17Z
|
||||
Facebook’s next hardware launch will be its Ray-Ban ‘smart glasses’ - The Verge,The Verge,2021-07-29,11:33:04Z
|
||||
Take your vlogs to the next level with Sony ZV-E10 - Irish Examiner,Irish Examiner,2021-07-29,11:30:00Z
|
||||
Four COVID-19 cases detected at 4 Catholic churches in Singapore - CNA,CNA,2021-07-29,11:27:55Z
|
||||
Zuma supporter Ngizwe Mchunu granted R2 000 bail - News24,News24,2021-07-29,11:25:57Z
|
||||
'You have to be unpopular^' says Mboweni - who will be minister as long as Ramaphosa needs him - News24,News24,2021-07-29,11:24:16Z
|
||||
|
|
@ -1,4 +1,4 @@
|
||||
name,current,opening
|
||||
MSFT,286.705,288.915
|
||||
NFLX,520.09,522.08
|
||||
GOOG,2740.95,2771.88
|
||||
MSFT,288.51,286.19
|
||||
NFLX,520.495,521.015
|
||||
GOOG,2732.56,2728.535
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.5 KiB |
@ -134,7 +134,7 @@ class StockTicker():
|
||||
time.sleep(self.delay)
|
||||
kill = self.checkKilled()
|
||||
if kill: break
|
||||
|
||||
if kill: break
|
||||
# for animation in gifs
|
||||
if offset_x%frame_skip == 0:
|
||||
self.incrementGIF(image)
|
||||
@ -163,7 +163,7 @@ class StockTicker():
|
||||
|
||||
|
||||
|
||||
if kill: break
|
||||
|
||||
|
||||
if kill: break
|
||||
return kill
|
||||
@ -193,6 +193,65 @@ class StockTicker():
|
||||
|
||||
return kill
|
||||
|
||||
def scrollImageTransition(self, image_files, offset_x = 0, offset_y = 0, stocks = True):
|
||||
# use two image files and switch between them with a seemless transition
|
||||
current_img = 1
|
||||
image1 = self.openImage(image_files[0]).convert('RGB')
|
||||
image2 = self.openImage(image_files[1]).convert('RGB')
|
||||
|
||||
double_buffer = self.matrix.CreateFrameCanvas()
|
||||
kill = False
|
||||
while True:
|
||||
|
||||
if current_img == 1:
|
||||
|
||||
if stocks:
|
||||
update_process = Process(target = self.getFullStockImage, args = (1,))
|
||||
update_process.start()
|
||||
image1 = self.openImage(image_files[0]).convert('RGB')
|
||||
image2 = self.openImage(image_files[1]).convert('RGB')
|
||||
|
||||
elif current_img == 2:
|
||||
|
||||
if stocks:
|
||||
update_process = Process(target = self.getFullStockImage, args = (2,))
|
||||
update_process.start()
|
||||
|
||||
image1 = self.openImage(image_files[1]).convert('RGB')
|
||||
image2 = self.openImage(image_files[0]).convert('RGB')
|
||||
|
||||
img_width, img_height = image1.size
|
||||
|
||||
|
||||
while offset_x > -img_width:
|
||||
offset_x -= 1
|
||||
|
||||
double_buffer.SetImage(image1, offset_x, offset_y)
|
||||
|
||||
|
||||
if offset_x + img_width < self.matrix.width: # if the image is ending
|
||||
double_buffer.SetImage(image2, offset_x, offset_y)
|
||||
|
||||
double_buffer = self.matrix.SwapOnVSync(double_buffer)
|
||||
|
||||
time.sleep(self.delay)
|
||||
kill = self.checkKilled()
|
||||
if kill: break
|
||||
|
||||
if stocks:
|
||||
image1.close()
|
||||
image2.close()
|
||||
|
||||
if kill: break
|
||||
|
||||
if stocks:
|
||||
update_process.join()
|
||||
if current_img == 1:
|
||||
current_img = 2
|
||||
elif current_img == 2:
|
||||
current_img = 1
|
||||
offset_x = 0
|
||||
|
||||
def scrollImageStacked(self, image, offset_x = 0, offset_y = 0):
|
||||
img_width, img_height = image.size
|
||||
|
||||
@ -282,13 +341,13 @@ class StockTicker():
|
||||
if animation == 'up':
|
||||
offset_y = 33
|
||||
direction = -1
|
||||
self.scrollImageY(image, direction = direction, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = options[i % len(options)] == 'display_gif')
|
||||
kill = self.scrollImageY(image, direction = direction, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = options[i % len(options)] == 'display_gif')
|
||||
elif animation == 'down':
|
||||
direction = 1
|
||||
offset_y = -33
|
||||
self.scrollImageY(image, direction = direction, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = options[i % len(options)] == 'display_gif')
|
||||
|
||||
kill = self.scrollImageY(image, direction = direction, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = options[i % len(options)] == 'display_gif')
|
||||
|
||||
if kill: break
|
||||
offset_y = 0
|
||||
|
||||
|
||||
@ -381,14 +440,15 @@ class StockTicker():
|
||||
if animation == 'up':
|
||||
offset_y = 33
|
||||
direction = -1
|
||||
self.scrollImageY(image, direction = direction, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = kind=='gif')
|
||||
kill = self.scrollImageY(image, direction = direction, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = kind=='gif')
|
||||
elif animation == 'down':
|
||||
direction = 1
|
||||
offset_y = -33
|
||||
self.scrollImageY(image, direction = direction, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = kind=='gif')
|
||||
kill = self.scrollImageY(image, direction = direction, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = kind=='gif')
|
||||
|
||||
|
||||
offset_y = 0
|
||||
if kill: break
|
||||
|
||||
kill = self.scrollImage(image, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = kind=='gif', pause_frames = pause_frames)
|
||||
|
||||
@ -1851,7 +1911,7 @@ class StockTicker():
|
||||
x_offset += stock.size[0]
|
||||
news.paste(forex, (x_offset, 16))
|
||||
x_offset += forex.size[0]
|
||||
|
||||
self.double_buffer = self.matrix.CreateFrameCanvas()
|
||||
while True:
|
||||
kill = stock_ticker.scrollImage(news, offset_x = 128)
|
||||
|
||||
@ -1943,9 +2003,10 @@ class StockTicker():
|
||||
self.scrollFunctionsAnimated(userSettings, animation = 'down')
|
||||
|
||||
elif msg == 'b':
|
||||
userSettings = ['stocks_prof', 'crypto_prof', 'forex_prof', 'today_weather_prof']
|
||||
#userSettings = ['stocks_prof', 'crypto_prof', 'forex_prof', 'today_weather_prof']
|
||||
|
||||
self.scrollFunctionsAnimatedProf(userSettings)
|
||||
#self.scrollFunctionsAnimatedProf(userSettings)
|
||||
self.displayProfessional()
|
||||
|
||||
elif msg == '+':
|
||||
stock_ticker.scrollMultiple()
|
||||
@ -1961,7 +2022,7 @@ if __name__ == '__main__':
|
||||
|
||||
start_image = Image.open('./logos/startup_logo.png')
|
||||
stock_ticker.setImage(start_image)
|
||||
time.sleep(10)
|
||||
time.sleep(1)
|
||||
stock_ticker.resetMatrix()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user