косметические изменения
This commit is contained in:
@@ -3,6 +3,9 @@ from jinja2 import Environment, FileSystemLoader
|
||||
import sys
|
||||
import os
|
||||
|
||||
with open('render-params.json') as f:
|
||||
GLOBAL_CONFIG = json.load(f)
|
||||
|
||||
|
||||
def extract_param_names(mc):
|
||||
result = []
|
||||
@@ -66,12 +69,10 @@ def extract_param_groups(mc):
|
||||
|
||||
|
||||
def build_modem_env(modem):
|
||||
with open('render-params.json') as f:
|
||||
config = json.load(f)
|
||||
if modem not in config['modem_types']:
|
||||
if modem not in GLOBAL_CONFIG['modem_types']:
|
||||
raise RuntimeError(f"Modem '{modem}' is not exist in config!")
|
||||
|
||||
mc = config['modem_types'][modem]
|
||||
mc = GLOBAL_CONFIG['modem_types'][modem]
|
||||
|
||||
add_submit_widgets(mc['params'])
|
||||
|
||||
@@ -99,9 +100,8 @@ def render_modem(modem):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
render_modem('scpc')
|
||||
render_modem('tdma')
|
||||
|
||||
os.system('cp -u main-tdma.html ../static')
|
||||
os.system('cp -u main-scpc.html ../static')
|
||||
for mt in GLOBAL_CONFIG['modem_types']:
|
||||
print(f'Generating {mt} modem...')
|
||||
render_modem(mt)
|
||||
os.system(f'cp -u main-{mt}.html ../static')
|
||||
|
||||
|
Reference in New Issue
Block a user