mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-25 20:41:21 -05:00
Corona: fix region totals
This commit is contained in:
parent
4f963a4817
commit
7b1b2ba4e1
@ -65,18 +65,18 @@ class Corona(callbacks.Plugin):
|
||||
return
|
||||
|
||||
total_confirmed = total_deaths = total_recovered = 0
|
||||
confirmed = deaths = recovered = 0
|
||||
|
||||
extra_output = None
|
||||
for region in features:
|
||||
r = region.get('attributes')
|
||||
|
||||
confirmed = r.get('Confirmed')
|
||||
deaths = r.get('Deaths')
|
||||
recovered = r.get('Recovered')
|
||||
|
||||
if search:
|
||||
name = r.get('Country_Region')
|
||||
if search.lower() in name.lower():
|
||||
confirmed += r.get('Confirmed')
|
||||
deaths += r.get('Deaths')
|
||||
recovered += r.get('Recovered')
|
||||
local_ratio_dead = deaths/confirmed
|
||||
extra_output = ' {0} infected, {1} dead ({4:.00%}), {2} recovered in {3}.'\
|
||||
.format(confirmed, deaths, recovered, name, local_ratio_dead)
|
||||
|
Loading…
x
Reference in New Issue
Block a user