Coverage for .tox/coverage/lib/python3.13/site-packages/wuttjamaican/cli/cleanup.py: 100%
10 statements
« prev ^ index » next coverage.py v7.16.1, created at 2026-09-20 15:04 -0500
« prev ^ index » next coverage.py v7.16.1, created at 2026-09-20 15:04 -0500
1# -*- coding: utf-8; -*-
2################################################################################
3#
4# WuttJamaican -- Base package for Wutta Framework
5# Copyright © 2023-2026 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-cleanup`
25"""
27try:
28 from typing import Annotated
29except ImportError: # pragma: no cover
30 from typing_extensions import Annotated
32import typer
34from .base import wutta_typer
37@wutta_typer.command()
38def cleanup(
39 ctx: typer.Context,
40 dry_run: Annotated[
41 bool,
42 typer.Option(
43 "--dry-run",
44 help="Go through motions and log actions, but do not commit the result.",
45 ),
46 ] = False,
47):
48 """
49 Run cleanup tasks to remove stale data/files
50 """
51 config = ctx.parent.wutta_config
52 app = config.get_app()
53 handler = app.get_cleanup_handler()
54 handler.cleanup_everything(dry_run=dry_run)