Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
add custom enum info from additional-enum-info.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
crhbetz committed Oct 24, 2020
1 parent db8ccc3 commit a14e358
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions additional-enum-info.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Form]
SABLEYE_COSTUME_2020 = 2668
10 changes: 10 additions & 0 deletions poraclePvpHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@ def parseEnumProto(url, name):
for line in r.iter_lines(decode_unicode=True):
if not line.startswith("syntax") and not line.startswith("package") and "=" in line:
enumDict[line.split("=")[0].strip()] = line.split("=")[1].replace(";", "").strip()
enumDict = addEnumInfo(name, enumDict)
return Enum(name, enumDict)


def addEnumInfo(name, enumDict):
additionalInfo = configparser.ConfigParser()
additionalInfo.read(os.path.dirname(os.path.abspath(__file__)) + "/additional-enum-info.ini")
if name in additionalInfo:
for elem in additionalInfo[name]:
enumDict[elem.upper()] = additionalInfo[name][elem]
return enumDict


PokemonId = parseEnumProto("https://raw.githubusercontent.com/Furtif/POGOProtos/master/src/"
"POGOProtos/Enums/PokemonId.proto", "PokemonId")
Form = parseEnumProto("https://raw.githubusercontent.com/Furtif/POGOProtos/master/src/"
Expand Down

0 comments on commit a14e358

Please sign in to comment.