Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

Commit

Permalink
Updated with support for Pending and Recovering States on Factions.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosparks committed Jun 26, 2017
1 parent 6c80929 commit a9cadf4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions influence.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,19 @@ def CreateUpdate(timestamp, starName, systemFaction, factionList):
data[prefix+"State"] = faction["FactionState"]
data[prefix+"Allegiance"] = faction["Allegiance"]
data[prefix+"Government"] = faction["Government"]
# Support for Pending/Recovering States
# since sheet is expecting either all information or none for
# each faction we always need to specify these, even if not present
states = []
if "PendingStates" in faction:
for pendingState in faction["PendingStates"]:
states.append(pendingState["State"])
data[prefix+"PendingState"] = ",".join(states)
states = []
if "RecoveringStates" in faction:
for recoveringState in faction["RecoveringStates"]:
states.append(recoveringState["State"])
data[prefix+"RecoveringState"] = ",".join(states)
factionNo = factionNo + 1
return data

Expand Down

0 comments on commit a9cadf4

Please sign in to comment.