Coverage for .tox/coverage/lib/python3.11/site-packages/wuttjamaican/cli/make_appdir.py: 100%
12 statements
« prev ^ index » next coverage.py v7.11.0, created at 2026-01-05 13:15 -0600
« prev ^ index » next coverage.py v7.11.0, created at 2026-01-05 13:15 -0600
1# -*- coding: utf-8; -*-
2################################################################################
3#
4# WuttJamaican -- Base package for Wutta Framework
5# Copyright © 2023-2025 Lance Edgar
6#
7# This file is part of Wutta Framework.
8#
9# Wutta Framework is free software: you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by the Free
11# Software Foundation, either version 3 of the License, or (at your option) any
12# later version.
13#
14# Wutta Framework is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17# more details.
18#
19# You should have received a copy of the GNU General Public License along with
20# Wutta Framework. If not, see <http://www.gnu.org/licenses/>.
21#
22################################################################################
23"""
24See also: :ref:`wutta-make-appdir`
25"""
27import sys
28from pathlib import Path
30import typer
31from typing_extensions import Annotated
33from .base import wutta_typer
36@wutta_typer.command()
37def make_appdir(
38 ctx: typer.Context,
39 appdir_path: Annotated[
40 Path,
41 typer.Option(
42 "--path",
43 help="Path to desired app dir; default is (usually) "
44 "`app` in the root of virtual environment.",
45 ),
46 ] = None,
47): # pylint: disable=unused-argument
48 """
49 Make the app dir for virtual environment
51 See also https://docs.wuttaproject.org/wuttjamaican/glossary.html#term-app-dir
52 """
53 config = ctx.parent.wutta_config
54 app = config.get_app()
55 appdir = ctx.params["appdir_path"] or app.get_appdir()
56 app.make_appdir(appdir)
57 sys.stdout.write(f"established appdir: {appdir}\n")