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:
parent
8cb32d75ad
commit
ab1b5c34cd
1 changed files with 17 additions and 0 deletions
17
codegen/lib/code/inventory.py
Normal file
17
codegen/lib/code/inventory.py
Normal 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.)
|
||||
|
Loading…
Add table
Reference in a new issue