comparison libervia/web/server/tasks/implicit/task_js_modules.py @ 1601:d07838fc9d99

minor updates
author Goffi <goffi@goffi.org>
date Sat, 11 May 2024 13:57:49 +0200
parents 038d4bfdd967
children
comparison
equal deleted inserted replaced
1600:0a4433a343a3 1601:d07838fc9d99
44 if ' ' in module_name: 44 if ' ' in module_name:
45 raise ValueError( 45 raise ValueError(
46 f"module {module_name!r} has space(s), it must not!") 46 f"module {module_name!r} has space(s), it must not!")
47 module_python_name = module_name.replace(".", "_").replace("-", "_") 47 module_python_name = module_name.replace(".", "_").replace("-", "_")
48 if module_python_name != module_name: 48 if module_python_name != module_name:
49 log.info("{module_python_name!r} will be used as python module name") 49 log.info(f"{module_python_name!r} will be used as python module name")
50 module_path = js_modules_path / f"{module_python_name}.py" 50 module_path = js_modules_path / f"{module_python_name}.py"
51 if isinstance(module_data, str): 51 if isinstance(module_data, str):
52 module_data = {'path': [module_data]} 52 module_data = {'path': [module_data]}
53 try: 53 try:
54 js_paths = module_data.pop('path') 54 js_paths = module_data.pop('path')