diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 21c6c49f..01d07793 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 24.3.0 hooks: - id: black entry: black --check diff --git a/docs/vitepress/assets/logos/trame-text.svg b/docs/vitepress/assets/logos/trame-text.svg index f62088d4..f613556a 100644 --- a/docs/vitepress/assets/logos/trame-text.svg +++ b/docs/vitepress/assets/logos/trame-text.svg @@ -1,38 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/trame/tools/app.py b/trame/tools/app.py index 53989012..03f13eaf 100644 --- a/trame/tools/app.py +++ b/trame/tools/app.py @@ -2,6 +2,7 @@ From the directory containing the static content for a trame application to work, generate another application specific HTML file. """ + import argparse import re from pathlib import Path diff --git a/trame/tools/widgets/generator.py b/trame/tools/widgets/generator.py index 266c7dd5..a4f009e8 100644 --- a/trame/tools/widgets/generator.py +++ b/trame/tools/widgets/generator.py @@ -54,9 +54,9 @@ async def create_base_structure(ref_path, config, output): config[name][sub_name][module][web_dir], ) # Register trame/modules/{webdir} - trame_plugins[ - f"trame/modules/{module}.py" - ] = f"from {name}.module.{module} import *\n" + trame_plugins[f"trame/modules/{module}.py"] = ( + f"from {name}.module.{module} import *\n" + ) create_module_init(module_root_init, module_conf_init) elif sub_name == "widgets": @@ -165,9 +165,9 @@ async def create_base_structure(ref_path, config, output): file.write("\n") # Register trame/modules/{webdir} - trame_plugins[ - f"trame/widgets/{module}.py" - ] = f"from {name}.widgets.{module} import *\n\ndef initialize(server):\n from {name}.module import {module}\n\n server.enable_module({module})\n" + trame_plugins[f"trame/widgets/{module}.py"] = ( + f"from {name}.widgets.{module} import *\n\ndef initialize(server):\n from {name}.module import {module}\n\n server.enable_module({module})\n" + ) # Create trame package connectors for file, content in trame_plugins.items(): diff --git a/trame/tools/www.py b/trame/tools/www.py index 7fcd3588..bb3d8352 100644 --- a/trame/tools/www.py +++ b/trame/tools/www.py @@ -2,6 +2,7 @@ From a list of trame modules name, gather and generate the required static content that needs to be served for a trame application to work. """ + import argparse import importlib import shutil @@ -10,6 +11,7 @@ class StaticContentGenerator: def __init__(self): + self.name = "www_generator" # required to look like a server self.www = None self.serve = {} self.client_type = "vue3"