Skip to content

Commit

Permalink
Fix #3
Browse files Browse the repository at this point in the history
- corona plugin lint
  • Loading branch information
paulosgf committed Jul 6, 2022
1 parent d5d558f commit 612e779
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions src/honeybot/plugins/downloaded/corona/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,32 @@ def scrape(self, country):
)
today = str(datetime.date.today())
msg = (
"The latest coronavirus pandemic figures as of "
+ today
+ " show "
+ " that there are currently "
+ str(cases[0].text.strip())
+ " cases of "
+ "coronavirus of which "
+ str(cases[2].text.strip())
+ " have recovered. "
+ "Unfortunately, "
+ str(cases[1].text.strip())
+ " patients have died as a "
+ "result of the coronavirus pandemic. May they rest in peace."
"The latest coronavirus pandemic figures as of " +
today +
" show " +
" that there are currently " +
str(cases[0].text.strip()) +
" cases of " +
"coronavirus of which " +
str(cases[2].text.strip()) +
" have recovered. " +
"Unfortunately, " +
str(cases[1].text.strip()) +
" patients have died as a " +
"result of the coronavirus pandemic. May they rest in peace."
)
msg += "The most affected countries are the following: \n"
for c in most_affected:
country = c[0]
total_cases = c[1]
deaths = c[2]
string = (
country
+ " has "
+ total_cases
+ " confirmed cases that have led to "
+ deaths
+ " deaths. RIP \n"
country +
" has " +
total_cases +
" confirmed cases that have led to " +
deaths +
" deaths. RIP \n"
)
msg += string
return msg
Expand Down Expand Up @@ -105,35 +105,35 @@ def scrape(self, country):
deaths = data[index + 3].text
recovered = data[index + 5].text
msg = (
"The latest coronavirus pandemic figures as of "
+ today
+ " for "
+ name
+ " show"
+ " that there are currently "
+ cases
+ " cases of coronavirus in "
+ name
+ "."
"The latest coronavirus pandemic figures as of " +
today +
" for " +
name +
" show" +
" that there are currently " +
cases +
" cases of coronavirus in " +
name +
"."
)
if recovered != " ":
msg += " Of these " + recovered + " have recovered. "
else:
msg += " None have recovered yet. "
if deaths != " ":
msg += (
"Unfortunately, "
+ deaths.strip()
+ " patients in "
+ name
+ " have died as a "
+ "result of the coronavirus pandemic. May they rest in peace."
"Unfortunately, " +
deaths.strip() +
" patients in " +
name +
" have died as a " +
"result of the coronavirus pandemic. May they rest in peace."
)
else:
msg += (
"Fortunately nobody has died yet in "
+ name
+ " as a result of coronavirus."
"Fortunately nobody has died yet in " +
name +
" as a result of coronavirus."
)
return msg
break
Expand Down

0 comments on commit 612e779

Please sign in to comment.