Loading src/climax/__init__.py +1 −1 Original line number Diff line number Diff line __version__ = "0.2.4" __version__ = "0.2.5" src/climax/__main__.py +39 −11 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ from bs4 import BeautifulSoup import shutil from functools import cache import socket import json from .eggs import get_yolk from .model import MaXProjectConfig, db as climax_db, DEFAULT_DOT_BASEX_FILE from .config import ( Loading Loading @@ -612,11 +613,27 @@ def info( directory: Annotated[ str, typer.Option(help=_("Dossier du projet MaX")) ] = os.getcwd(), json_out: bool = False, ): directory = Path(directory).resolve() check_dir_is_max(directory) os.chdir(directory) config = max_config(directory) if json_out: print( json.dumps( { "max_version": config.max_version.get("name"), "title": config.title, "environment": config.env, "languages": config.languages, "bundles": config.bundles, "vocabulary_bundle": config.vocabulary_bundle, }, indent=4, ) ) else: console = Console() table = Table(_("Nom"), _("Valeur"), show_lines=True) table.add_row(_("Version de MaX"), config.max_version.get("name")) Loading Loading @@ -956,10 +973,11 @@ def static_list( @app.command(help=_("Liste les projets gérés par climax")) def projects(): def projects(json_out: bool = False): console = Console() table = Table(_("Projet"), _("Chemin"), _("URL"), show_lines=True) db = climax_db() projects_list = [] for max_install in db.projects(): if max_install.exists(): config = max_install.config() Loading @@ -970,9 +988,19 @@ def projects(): ): url = f"http://{max_install.meta.get('http_host')}:{max_install.meta.get('http_port')}/" table.add_row(config.title, max_install.path, url) projects_list.append( { "title": str(config.title), "path": str(max_install.path), "url": str(url), } ) else: db.delete("maxinstall", "id = ?", max_install.id) db.commit() if json_out: print(json.dumps({"projects": projects_list}, indent=4)) else: console.print(table) Loading src/climax/model.py +1 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ class MaxInstall: @property def meta(self) -> dict: if self._meta is not None: if self._meta: return json.loads(self._meta) return {} Loading Loading
src/climax/__init__.py +1 −1 Original line number Diff line number Diff line __version__ = "0.2.4" __version__ = "0.2.5"
src/climax/__main__.py +39 −11 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ from bs4 import BeautifulSoup import shutil from functools import cache import socket import json from .eggs import get_yolk from .model import MaXProjectConfig, db as climax_db, DEFAULT_DOT_BASEX_FILE from .config import ( Loading Loading @@ -612,11 +613,27 @@ def info( directory: Annotated[ str, typer.Option(help=_("Dossier du projet MaX")) ] = os.getcwd(), json_out: bool = False, ): directory = Path(directory).resolve() check_dir_is_max(directory) os.chdir(directory) config = max_config(directory) if json_out: print( json.dumps( { "max_version": config.max_version.get("name"), "title": config.title, "environment": config.env, "languages": config.languages, "bundles": config.bundles, "vocabulary_bundle": config.vocabulary_bundle, }, indent=4, ) ) else: console = Console() table = Table(_("Nom"), _("Valeur"), show_lines=True) table.add_row(_("Version de MaX"), config.max_version.get("name")) Loading Loading @@ -956,10 +973,11 @@ def static_list( @app.command(help=_("Liste les projets gérés par climax")) def projects(): def projects(json_out: bool = False): console = Console() table = Table(_("Projet"), _("Chemin"), _("URL"), show_lines=True) db = climax_db() projects_list = [] for max_install in db.projects(): if max_install.exists(): config = max_install.config() Loading @@ -970,9 +988,19 @@ def projects(): ): url = f"http://{max_install.meta.get('http_host')}:{max_install.meta.get('http_port')}/" table.add_row(config.title, max_install.path, url) projects_list.append( { "title": str(config.title), "path": str(max_install.path), "url": str(url), } ) else: db.delete("maxinstall", "id = ?", max_install.id) db.commit() if json_out: print(json.dumps({"projects": projects_list}, indent=4)) else: console.print(table) Loading
src/climax/model.py +1 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ class MaxInstall: @property def meta(self) -> dict: if self._meta is not None: if self._meta: return json.loads(self._meta) return {} Loading