deepctl-cmd-ffprobe 0.0.2__tar.gz → 0.0.3__tar.gz
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.
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/PKG-INFO +1 -1
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/pyproject.toml +1 -1
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/src/deepctl_cmd_ffprobe/command.py +47 -23
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/src/deepctl_cmd_ffprobe.egg-info/PKG-INFO +1 -1
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/README.md +0 -0
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/setup.cfg +0 -0
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/src/deepctl_cmd_ffprobe/__init__.py +0 -0
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/src/deepctl_cmd_ffprobe/models.py +0 -0
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/src/deepctl_cmd_ffprobe.egg-info/SOURCES.txt +0 -0
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/src/deepctl_cmd_ffprobe.egg-info/dependency_links.txt +0 -0
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/src/deepctl_cmd_ffprobe.egg-info/entry_points.txt +0 -0
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/src/deepctl_cmd_ffprobe.egg-info/requires.txt +0 -0
- {deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/src/deepctl_cmd_ffprobe.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "deepctl-cmd-ffprobe"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.3" # x-release-please-version
|
|
8
8
|
description = "FFprobe configuration command for deepctl"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -7,16 +7,35 @@ import shutil
|
|
|
7
7
|
import subprocess
|
|
8
8
|
from typing import Any
|
|
9
9
|
|
|
10
|
-
from deepctl_core import
|
|
10
|
+
from deepctl_core import (
|
|
11
|
+
AuthManager,
|
|
12
|
+
BaseCommand,
|
|
13
|
+
BaseResult,
|
|
14
|
+
Config,
|
|
15
|
+
DeepgramClient,
|
|
16
|
+
get_console,
|
|
17
|
+
get_output_format,
|
|
18
|
+
get_status_console,
|
|
19
|
+
)
|
|
11
20
|
from deepctl_shared_utils import (
|
|
12
21
|
get_ffprobe_path,
|
|
13
22
|
print_ffprobe_install_instructions,
|
|
14
23
|
)
|
|
15
|
-
from rich.console import Console
|
|
16
24
|
|
|
17
25
|
from .models import FfprobeResult
|
|
18
26
|
|
|
19
|
-
|
|
27
|
+
# Two channels, deliberately (#104):
|
|
28
|
+
# console -> stdout, the human rendering of the FfprobeResult.
|
|
29
|
+
# Written only in default (human) output mode, so
|
|
30
|
+
# `dg -o json ffprobe | jq` sees the payload alone.
|
|
31
|
+
# status_console -> stderr, always: errors and install instructions.
|
|
32
|
+
console = get_console()
|
|
33
|
+
status_console = get_status_console()
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _human_output() -> bool:
|
|
37
|
+
"""True when stdout is for a person, not a parser."""
|
|
38
|
+
return get_output_format() == "default"
|
|
20
39
|
|
|
21
40
|
|
|
22
41
|
class FfprobeCommand(BaseCommand):
|
|
@@ -74,7 +93,9 @@ class FfprobeCommand(BaseCommand):
|
|
|
74
93
|
reset = kwargs.get("reset", False)
|
|
75
94
|
|
|
76
95
|
if path and reset:
|
|
77
|
-
|
|
96
|
+
status_console.print(
|
|
97
|
+
"[red]Error:[/red] Cannot use --path and --reset together"
|
|
98
|
+
)
|
|
78
99
|
return BaseResult(
|
|
79
100
|
status="error",
|
|
80
101
|
message="Cannot use --path and --reset together",
|
|
@@ -92,11 +113,11 @@ class FfprobeCommand(BaseCommand):
|
|
|
92
113
|
"""Store a custom ffprobe path."""
|
|
93
114
|
# Validate the path
|
|
94
115
|
if not os.path.isfile(path):
|
|
95
|
-
|
|
116
|
+
status_console.print(f"[red]Error:[/red] File not found: {path}")
|
|
96
117
|
return BaseResult(status="error", message=f"File not found: {path}")
|
|
97
118
|
|
|
98
119
|
if not os.access(path, os.X_OK):
|
|
99
|
-
|
|
120
|
+
status_console.print(f"[red]Error:[/red] File is not executable: {path}")
|
|
100
121
|
return BaseResult(status="error", message=f"File is not executable: {path}")
|
|
101
122
|
|
|
102
123
|
# Store in config
|
|
@@ -104,9 +125,10 @@ class FfprobeCommand(BaseCommand):
|
|
|
104
125
|
config.save()
|
|
105
126
|
|
|
106
127
|
version = self._get_version(path)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
128
|
+
if _human_output():
|
|
129
|
+
console.print(f"[green]✓[/green] ffprobe path stored: {path}")
|
|
130
|
+
if version:
|
|
131
|
+
console.print(f" Version: {version}")
|
|
110
132
|
|
|
111
133
|
return FfprobeResult(
|
|
112
134
|
status="success",
|
|
@@ -121,14 +143,14 @@ class FfprobeCommand(BaseCommand):
|
|
|
121
143
|
config._config.tools.ffprobe_path = None
|
|
122
144
|
config.save()
|
|
123
145
|
|
|
124
|
-
console.print("[green]✓[/green] Stored ffprobe path cleared")
|
|
125
|
-
|
|
126
146
|
# Show auto-detected path
|
|
127
147
|
auto_path = shutil.which("ffprobe")
|
|
128
|
-
if
|
|
129
|
-
console.print(
|
|
130
|
-
|
|
131
|
-
|
|
148
|
+
if _human_output():
|
|
149
|
+
console.print("[green]✓[/green] Stored ffprobe path cleared")
|
|
150
|
+
if auto_path:
|
|
151
|
+
console.print(f" Auto-detected: {auto_path}")
|
|
152
|
+
else:
|
|
153
|
+
console.print(" [yellow]ffprobe not found in PATH[/yellow]")
|
|
132
154
|
|
|
133
155
|
return FfprobeResult(
|
|
134
156
|
status="success",
|
|
@@ -143,17 +165,19 @@ class FfprobeCommand(BaseCommand):
|
|
|
143
165
|
auto_path = shutil.which("ffprobe")
|
|
144
166
|
effective_path = get_ffprobe_path(config)
|
|
145
167
|
|
|
146
|
-
if
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
168
|
+
if _human_output():
|
|
169
|
+
if stored_path:
|
|
170
|
+
console.print(f" Stored path: {stored_path}")
|
|
171
|
+
if auto_path:
|
|
172
|
+
console.print(f" Auto-detected: {auto_path}")
|
|
150
173
|
|
|
151
174
|
if effective_path:
|
|
152
175
|
version = self._get_version(effective_path)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
176
|
+
if _human_output():
|
|
177
|
+
console.print(f" Active path: [green]{effective_path}[/green]")
|
|
178
|
+
if version:
|
|
179
|
+
console.print(f" Version: {version}")
|
|
180
|
+
console.print("\n[green]✓[/green] ffprobe is available")
|
|
157
181
|
|
|
158
182
|
return FfprobeResult(
|
|
159
183
|
status="success",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deepctl_cmd_ffprobe-0.0.2 → deepctl_cmd_ffprobe-0.0.3}/src/deepctl_cmd_ffprobe.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|