Skip to content

Commit

Permalink
Worked on fixing more bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
o355 committed May 30, 2018
1 parent 136a61e commit 634ddc6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pyweather.py
Original file line number Diff line number Diff line change
Expand Up @@ -6685,6 +6685,8 @@ def frontend_playerControls(btnName):
activestorms += 1
logger.debug("activestorms: %s" % activestorms)

hurricane_iteratedstorms_iterationcount = 0

if activestorms == 0:
spinner.fail(text="There are no active tropical storms at this time.")
continue
Expand All @@ -6698,6 +6700,29 @@ def frontend_playerControls(btnName):
# However, if the storm name has shown up, increase all iteration variables by 1 and iterate to the next storm.
# If we detect that this is the last storm that we're iterating on, throw a duplicate message and an enter to exit prompt.

hurricane_ISLoop_iterations = 0
for term in hurricane_iteratedstorms:
if term == stormname:
currentstormiterations += 1
# If the currentstormiterations now equals total active storms, tell the user and quit.
if currentstormiterations == activestorms:
print(Fore.RED + "Duplicate storm information was detected. There is no more hurricane data to display.",
Fore.RED + "Press enter to exit to the main menu.")
input()
break
else:
continue
else:
hurricane_iteratedstorms.append(stormname)
logger.debug("hurricane_iteratedstorms: %s" % hurricane_iteratedstorms)
continue

# If we have 0 storm iterations, the for loop above will not iterate, so add the storm name manually.
if currentstormiterations == 0:
hurricane_iteratedstorms.append(stormname)



logger.debug("stormname: %s" % stormname)
stormlat = float(data['Current']['lat'])
# Make a *url variable to store the raw lat/lon in str() format.
Expand Down

0 comments on commit 634ddc6

Please sign in to comment.