1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

start adding inventory codegen

This commit is contained in:
Ubuntu 2022-12-03 05:21:20 +00:00
parent 8cb32d75ad
commit ab1b5c34cd

View file

@ -0,0 +1,17 @@
# The directoey where declare_menus! {} is done
inventory_menus_dir = get_dir_location(f'../azalea-inventory/src/lib.rs')
def update_menus():
with open(inventory_menus_dir, 'r') as f:
menus_rs = f.read().splitlines()
current_menus = []
in_the_macro = False
for line in menus_rs:
if line.startswith('declare_menus!'):
in_the_macro = True
if in_the_macro:
if line.startswith(' ') and line.endswith('{'):
current_menus.append(line.)