Skip to content

Commit

Permalink
constants_generator: display progress
Browse files Browse the repository at this point in the history
  • Loading branch information
sultanqasim committed Jun 5, 2024
1 parent 940751b commit d93fbc9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python_cli/sniffle/advdata/constants_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,26 @@ def pretty_print_dict(d, key_digits=4):
return "\n".join(lines)

def main():
print("Fetching company identifiers")
comp_ids_yaml = fetch_assigned_numbers("company_identifiers/company_identifiers.yaml")
company_identifiers = {}
for c in decode_yaml(comp_ids_yaml)["company_identifiers"]:
company_identifiers[c["value"]] = c["name"]

print("Fetching AD types")
ad_types_yaml = fetch_assigned_numbers("core/ad_types.yaml")
ad_types = {}
for t in decode_yaml(ad_types_yaml)["ad_types"]:
ad_types[t["value"]] = t["name"]

print("Fetching service UUIDs")
service_uuids_yaml = fetch_assigned_numbers("uuids/service_uuids.yaml")
service_uuids16 = {}
for u in decode_yaml(service_uuids_yaml)["uuids"]:
service_uuids16[u["uuid"]] = u["name"]

constants_file_path = os.path.join(os.path.dirname(__file__), "constants.py")
print("Writing", constants_file_path)
with open(constants_file_path, 'w') as f:
f.write("# Auto generated by constants_generator.py\n\n")
f.write("company_identifiers = ")
Expand Down

0 comments on commit d93fbc9

Please sign in to comment.