lsdsk 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lsdsk/__init__.py +19 -0
- lsdsk/__init__conf__.py +90 -0
- lsdsk/__main__.py +9 -0
- lsdsk/adapters/__init__.py +14 -0
- lsdsk/adapters/cli/__init__.py +80 -0
- lsdsk/adapters/cli/commands/__init__.py +49 -0
- lsdsk/adapters/cli/commands/config.py +452 -0
- lsdsk/adapters/cli/commands/history.py +311 -0
- lsdsk/adapters/cli/commands/info.py +72 -0
- lsdsk/adapters/cli/commands/logging.py +34 -0
- lsdsk/adapters/cli/commands/scan.py +632 -0
- lsdsk/adapters/cli/constants.py +22 -0
- lsdsk/adapters/cli/context.py +162 -0
- lsdsk/adapters/cli/envelope.py +58 -0
- lsdsk/adapters/cli/exit_codes.py +61 -0
- lsdsk/adapters/cli/main.py +146 -0
- lsdsk/adapters/cli/py.typed +0 -0
- lsdsk/adapters/cli/root.py +235 -0
- lsdsk/adapters/cli/safe_console.py +213 -0
- lsdsk/adapters/cli/typed_click.py +51 -0
- lsdsk/adapters/config/__init__.py +25 -0
- lsdsk/adapters/config/defaultconfig.d/40-layered-config.toml +71 -0
- lsdsk/adapters/config/defaultconfig.d/50-history.toml +65 -0
- lsdsk/adapters/config/defaultconfig.d/60-thresholds.toml +108 -0
- lsdsk/adapters/config/defaultconfig.d/70-display.toml +56 -0
- lsdsk/adapters/config/defaultconfig.d/90-logging.toml +432 -0
- lsdsk/adapters/config/defaultconfig.toml +46 -0
- lsdsk/adapters/config/deploy.py +122 -0
- lsdsk/adapters/config/display.py +72 -0
- lsdsk/adapters/config/history.py +99 -0
- lsdsk/adapters/config/loader.py +196 -0
- lsdsk/adapters/config/overrides.py +191 -0
- lsdsk/adapters/config/permissions.py +222 -0
- lsdsk/adapters/config/py.typed +0 -0
- lsdsk/adapters/config/secrets.py +124 -0
- lsdsk/adapters/config/tunables.py +173 -0
- lsdsk/adapters/history/__init__.py +27 -0
- lsdsk/adapters/history/store.py +306 -0
- lsdsk/adapters/hw/__init__.py +19 -0
- lsdsk/adapters/hw/decode/__init__.py +26 -0
- lsdsk/adapters/hw/decode/ahci.py +130 -0
- lsdsk/adapters/hw/decode/ata_identify.py +263 -0
- lsdsk/adapters/hw/decode/ata_smart.py +276 -0
- lsdsk/adapters/hw/decode/nvme.py +145 -0
- lsdsk/adapters/hw/decode/pciids.py +225 -0
- lsdsk/adapters/hw/decode/text.py +48 -0
- lsdsk/adapters/hw/decode/virtualization.py +300 -0
- lsdsk/adapters/hw/linux/__init__.py +12 -0
- lsdsk/adapters/hw/linux/builder.py +647 -0
- lsdsk/adapters/hw/linux/reader.py +759 -0
- lsdsk/adapters/hw/snapshot.py +283 -0
- lsdsk/adapters/hw/windows/__init__.py +15 -0
- lsdsk/adapters/hw/windows/builder.py +346 -0
- lsdsk/adapters/hw/windows/reader.py +658 -0
- lsdsk/adapters/hw/windows/winapi.py +613 -0
- lsdsk/adapters/logging/__init__.py +13 -0
- lsdsk/adapters/logging/py.typed +0 -0
- lsdsk/adapters/logging/setup.py +134 -0
- lsdsk/adapters/memory/__init__.py +57 -0
- lsdsk/adapters/memory/config.py +65 -0
- lsdsk/adapters/memory/history.py +74 -0
- lsdsk/adapters/memory/info.py +41 -0
- lsdsk/adapters/memory/logging.py +18 -0
- lsdsk/adapters/py.typed +0 -0
- lsdsk/adapters/render/__init__.py +11 -0
- lsdsk/adapters/render/full.py +114 -0
- lsdsk/adapters/render/layout.py +184 -0
- lsdsk/adapters/render/report.py +813 -0
- lsdsk/adapters/render/rows.py +17 -0
- lsdsk/adapters/render/tables.py +367 -0
- lsdsk/adapters/render/theme.py +385 -0
- lsdsk/adapters/render/trend.py +265 -0
- lsdsk/adapters/textfile.py +86 -0
- lsdsk/adapters/tui/__init__.py +10 -0
- lsdsk/adapters/tui/app.py +340 -0
- lsdsk/adapters/tui/typed_table.py +65 -0
- lsdsk/application/__init__.py +26 -0
- lsdsk/application/ports.py +101 -0
- lsdsk/application/py.typed +0 -0
- lsdsk/composition/__init__.py +113 -0
- lsdsk/composition/py.typed +0 -0
- lsdsk/domain/__init__.py +39 -0
- lsdsk/domain/diagnostics.py +1070 -0
- lsdsk/domain/enums.py +242 -0
- lsdsk/domain/errors.py +44 -0
- lsdsk/domain/history.py +663 -0
- lsdsk/domain/models.py +865 -0
- lsdsk/domain/py.typed +0 -0
- lsdsk/domain/thresholds.py +61 -0
- lsdsk/entry.py +26 -0
- lsdsk/py.typed +0 -0
- lsdsk-1.0.0.dist-info/METADATA +466 -0
- lsdsk-1.0.0.dist-info/RECORD +96 -0
- lsdsk-1.0.0.dist-info/WHEEL +4 -0
- lsdsk-1.0.0.dist-info/entry_points.txt +2 -0
- lsdsk-1.0.0.dist-info/licenses/LICENSE +22 -0
lsdsk/__init__.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Public package surface: configuration and package metadata.
|
|
2
|
+
|
|
3
|
+
lsdsk is a command-line tool, so its public Python surface is deliberately
|
|
4
|
+
small. Everything a reader wants is behind the CLI or, for a program, behind
|
|
5
|
+
``lsdsk <command> --format json``.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
# Metadata
|
|
11
|
+
from .__init__conf__ import print_info
|
|
12
|
+
|
|
13
|
+
# Composition exports (wired adapters)
|
|
14
|
+
from .composition import get_config
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"get_config",
|
|
18
|
+
"print_info",
|
|
19
|
+
]
|
lsdsk/__init__conf__.py
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""Static package metadata surfaced to CLI commands and documentation.
|
|
2
|
+
|
|
3
|
+
Purpose
|
|
4
|
+
-------
|
|
5
|
+
Expose the current project metadata as simple constants. These values are kept
|
|
6
|
+
in sync with ``pyproject.toml`` by development automation (tests, push
|
|
7
|
+
pipelines), so runtime code does not query packaging metadata.
|
|
8
|
+
|
|
9
|
+
Contents
|
|
10
|
+
--------
|
|
11
|
+
* Module-level constants describing the published package.
|
|
12
|
+
* :func:`print_info` rendering the constants for the CLI ``info`` command.
|
|
13
|
+
|
|
14
|
+
System Role
|
|
15
|
+
-----------
|
|
16
|
+
Lives in the adapters/platform layer; CLI transports import these constants to
|
|
17
|
+
present authoritative project information without invoking packaging APIs.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import sys
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"LAYEREDCONF_APP",
|
|
26
|
+
"LAYEREDCONF_SLUG",
|
|
27
|
+
"LAYEREDCONF_VENDOR",
|
|
28
|
+
"author",
|
|
29
|
+
"author_email",
|
|
30
|
+
"homepage",
|
|
31
|
+
"name",
|
|
32
|
+
"print_info",
|
|
33
|
+
"shell_command",
|
|
34
|
+
"title",
|
|
35
|
+
"version",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
#: Distribution name declared in ``pyproject.toml``.
|
|
39
|
+
name = "lsdsk"
|
|
40
|
+
#: Human-readable summary shown in CLI help output.
|
|
41
|
+
title = "See your disks and controllers, and what is wrong with how they are connected"
|
|
42
|
+
#: Current release version pulled from ``pyproject.toml`` by automation.
|
|
43
|
+
version = "1.0.0"
|
|
44
|
+
#: Repository homepage presented to users.
|
|
45
|
+
homepage = "https://github.com/bitranox/lsdsk"
|
|
46
|
+
#: Author attribution surfaced in CLI output.
|
|
47
|
+
author = "bitranox"
|
|
48
|
+
#: Contact email surfaced in CLI output.
|
|
49
|
+
author_email = "bitranox@gmail.com"
|
|
50
|
+
#: Console-script name published by the package.
|
|
51
|
+
shell_command = "lsdsk"
|
|
52
|
+
|
|
53
|
+
#: Vendor identifier for lib_layered_config paths (macOS/Windows)
|
|
54
|
+
LAYEREDCONF_VENDOR: str = "bitranox"
|
|
55
|
+
#: Application display name for lib_layered_config paths (macOS/Windows)
|
|
56
|
+
LAYEREDCONF_APP: str = "lsdsk"
|
|
57
|
+
#: Configuration slug for lib_layered_config Linux paths and environment variables
|
|
58
|
+
LAYEREDCONF_SLUG: str = "lsdsk"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def print_info() -> None:
|
|
62
|
+
"""Print the summarised metadata block used by the CLI ``info`` command.
|
|
63
|
+
|
|
64
|
+
Why
|
|
65
|
+
Provides a single, auditable rendering function so documentation and
|
|
66
|
+
CLI output always match the system design reference.
|
|
67
|
+
|
|
68
|
+
Side Effects
|
|
69
|
+
Writes to ``stdout``.
|
|
70
|
+
|
|
71
|
+
Examples
|
|
72
|
+
--------
|
|
73
|
+
>>> print_info() # doctest: +ELLIPSIS
|
|
74
|
+
Info for lsdsk:
|
|
75
|
+
...
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
fields = [
|
|
79
|
+
("name", name),
|
|
80
|
+
("title", title),
|
|
81
|
+
("version", version),
|
|
82
|
+
("homepage", homepage),
|
|
83
|
+
("author", author),
|
|
84
|
+
("author_email", author_email),
|
|
85
|
+
("shell_command", shell_command),
|
|
86
|
+
]
|
|
87
|
+
pad = max(len(label) for label, _ in fields)
|
|
88
|
+
lines = [f"Info for {name}:", ""]
|
|
89
|
+
lines.extend(f" {label.ljust(pad)} = {value}" for label, value in fields)
|
|
90
|
+
sys.stdout.write("\n".join(lines) + "\n")
|
lsdsk/__main__.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Adapters layer - infrastructure and framework integrations.
|
|
2
|
+
|
|
3
|
+
Contains adapter implementations that connect the application to external
|
|
4
|
+
systems and frameworks (CLI, configuration, hardware, logging, rendering).
|
|
5
|
+
|
|
6
|
+
Contents:
|
|
7
|
+
* :mod:`.config` - Configuration loading, deployment, and display
|
|
8
|
+
* :mod:`.logging` - Logging setup with lib_log_rich
|
|
9
|
+
* :mod:`.cli` - Click CLI framework integration
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
__all__: list[str] = []
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""CLI package providing the command-line interface.
|
|
2
|
+
|
|
3
|
+
Re-exports all public symbols from submodules for convenient access.
|
|
4
|
+
|
|
5
|
+
Contents:
|
|
6
|
+
* Click context helpers and traceback state management from :mod:`.context`
|
|
7
|
+
* Root command group from :mod:`.root`
|
|
8
|
+
* Entry point from :mod:`.main`
|
|
9
|
+
* All command functions from :mod:`.commands`
|
|
10
|
+
|
|
11
|
+
System Role:
|
|
12
|
+
Acts as the public facade for the CLI subsystem. Consumers import from here
|
|
13
|
+
and remain insulated from internal module boundaries.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
from .commands import (
|
|
19
|
+
cli_config,
|
|
20
|
+
cli_config_deploy,
|
|
21
|
+
cli_config_generate_examples,
|
|
22
|
+
cli_controllers,
|
|
23
|
+
cli_disks,
|
|
24
|
+
cli_fail,
|
|
25
|
+
cli_findings,
|
|
26
|
+
cli_health,
|
|
27
|
+
cli_info,
|
|
28
|
+
cli_logdemo,
|
|
29
|
+
cli_record,
|
|
30
|
+
cli_slots,
|
|
31
|
+
cli_smart,
|
|
32
|
+
cli_snapshot,
|
|
33
|
+
cli_topology,
|
|
34
|
+
cli_trend,
|
|
35
|
+
cli_tui,
|
|
36
|
+
)
|
|
37
|
+
from .constants import CLICK_CONTEXT_SETTINGS
|
|
38
|
+
from .context import (
|
|
39
|
+
TracebackState,
|
|
40
|
+
apply_traceback_preferences,
|
|
41
|
+
restore_traceback_state,
|
|
42
|
+
snapshot_traceback_state,
|
|
43
|
+
store_cli_context,
|
|
44
|
+
)
|
|
45
|
+
from .main import main
|
|
46
|
+
from .root import cli
|
|
47
|
+
|
|
48
|
+
__all__ = [
|
|
49
|
+
# Constants
|
|
50
|
+
"CLICK_CONTEXT_SETTINGS",
|
|
51
|
+
# Traceback management
|
|
52
|
+
"TracebackState",
|
|
53
|
+
"apply_traceback_preferences",
|
|
54
|
+
# Root command
|
|
55
|
+
"cli",
|
|
56
|
+
# Commands
|
|
57
|
+
"cli_config",
|
|
58
|
+
"cli_config_deploy",
|
|
59
|
+
"cli_config_generate_examples",
|
|
60
|
+
"cli_controllers",
|
|
61
|
+
"cli_disks",
|
|
62
|
+
"cli_fail",
|
|
63
|
+
"cli_findings",
|
|
64
|
+
"cli_health",
|
|
65
|
+
"cli_info",
|
|
66
|
+
"cli_logdemo",
|
|
67
|
+
"cli_record",
|
|
68
|
+
"cli_slots",
|
|
69
|
+
"cli_smart",
|
|
70
|
+
"cli_snapshot",
|
|
71
|
+
"cli_topology",
|
|
72
|
+
"cli_trend",
|
|
73
|
+
"cli_tui",
|
|
74
|
+
# Entry point
|
|
75
|
+
"main",
|
|
76
|
+
"restore_traceback_state",
|
|
77
|
+
"snapshot_traceback_state",
|
|
78
|
+
# Context helpers
|
|
79
|
+
"store_cli_context",
|
|
80
|
+
]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""CLI command implementations.
|
|
2
|
+
|
|
3
|
+
Collects all subcommand functions and re-exports them for registration
|
|
4
|
+
with the root CLI group.
|
|
5
|
+
|
|
6
|
+
Contents:
|
|
7
|
+
* Info commands from :mod:`.info`
|
|
8
|
+
* Config commands from :mod:`.config`
|
|
9
|
+
* Logging commands from :mod:`.logging`
|
|
10
|
+
* Storage commands from :mod:`.scan`
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from .config import cli_config, cli_config_deploy, cli_config_generate_examples
|
|
16
|
+
from .history import cli_record, cli_trend
|
|
17
|
+
from .info import cli_fail, cli_info
|
|
18
|
+
from .logging import cli_logdemo
|
|
19
|
+
from .scan import (
|
|
20
|
+
cli_controllers,
|
|
21
|
+
cli_disks,
|
|
22
|
+
cli_findings,
|
|
23
|
+
cli_health,
|
|
24
|
+
cli_slots,
|
|
25
|
+
cli_smart,
|
|
26
|
+
cli_snapshot,
|
|
27
|
+
cli_topology,
|
|
28
|
+
cli_tui,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
__all__ = [
|
|
32
|
+
"cli_config",
|
|
33
|
+
"cli_config_deploy",
|
|
34
|
+
"cli_config_generate_examples",
|
|
35
|
+
"cli_controllers",
|
|
36
|
+
"cli_disks",
|
|
37
|
+
"cli_fail",
|
|
38
|
+
"cli_findings",
|
|
39
|
+
"cli_health",
|
|
40
|
+
"cli_info",
|
|
41
|
+
"cli_logdemo",
|
|
42
|
+
"cli_record",
|
|
43
|
+
"cli_slots",
|
|
44
|
+
"cli_smart",
|
|
45
|
+
"cli_snapshot",
|
|
46
|
+
"cli_topology",
|
|
47
|
+
"cli_trend",
|
|
48
|
+
"cli_tui",
|
|
49
|
+
]
|