Skip to content

Commit

Permalink
Error handling/bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpwalsh1 committed Sep 13, 2020
1 parent 405a045 commit 1778158
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions NicEDInfo/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
this = sys.modules[__name__]
this.plugin_name = "Nic ED Info"
this.plugin_url = "https://github.com/jpwalsh1/NicEDInfo"
this.version_info = (0, 3, 0)
this.version_info = (0, 3, 1)
this.version = ".".join(map(str, this.version_info))
this.missions = {}

Expand Down Expand Up @@ -112,10 +112,14 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
elif entry["event"] in ["MissionAccepted"] and not is_beta:
if entry["Name"] in ["Mission_DS_PassengerBulk"]:
this.missions[entry["MissionID"]] = entry["PassengerCount"]
this.status["text"] = "Passenger Mission Accepted: {} passengers".format(entry["PassengerCount"])
# Create/Ensure the passenger file exists
passenger_path = config.get('outdir') + "/passengers.txt"
with open(passenger_path, "w") as passenger_file:
try:
with open(passenger_path, "x") as passenger_file:
pass
except FileExistsError:
pass
this.status["text"] = "Passenger Mission Accepted: {} passengers".format(entry["PassengerCount"])

# Once mission is completed, grab current total, add passengers from mission, update file
elif entry["event"] in ["MissionCompleted"] and not is_beta:
Expand Down

0 comments on commit 1778158

Please sign in to comment.