Skip to content

Commit

Permalink
Print debug even if PyAV not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Jan 5, 2025
1 parent e0cc395 commit 11fb4d4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion auto_editor/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "26.1.0"
__version__ = "26.1.1"
18 changes: 11 additions & 7 deletions auto_editor/__main__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3

import platform as plat
import re
import sys
from os import environ
from os.path import exists, isdir, isfile, lexists, splitext
from subprocess import run

import auto_editor
from auto_editor.edit import edit_media
from auto_editor.utils.func import get_stdout
from auto_editor.utils.log import Log
from auto_editor.utils.types import (
Expand Down Expand Up @@ -329,15 +329,17 @@ def main() -> None:
return

if args.debug and not args.input:
import platform as plat
print(f"OS: {plat.system()} {plat.release()} {plat.machine().lower()}")
print(f"Python: {plat.python_version()}")

import av
try:
import av

license = av._core.library_meta["libavcodec"]["license"]
license = av._core.library_meta["libavcodec"]["license"]
print(f"PyAV: {av.__version__} ({license})")
except (ModuleNotFoundError, ImportError):
print("PyAV: error")

print(f"OS: {plat.system()} {plat.release()} {plat.machine().lower()}")
print(f"Python: {plat.python_version()}")
print(f"PyAV: {av.__version__} ({license})")
print(f"Auto-Editor: {auto_editor.__version__}")
return

Expand All @@ -363,6 +365,8 @@ def main() -> None:
log.error(f"Option/Input file doesn't exist: {my_input}")
paths.append(my_input)

from auto_editor.edit import edit_media

try:
edit_media(paths, args, log)
except KeyboardInterrupt:
Expand Down
5 changes: 3 additions & 2 deletions auto_editor/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from shutil import get_terminal_size, rmtree
from tempfile import mkdtemp
from time import perf_counter, sleep
from typing import NoReturn
from typing import TYPE_CHECKING, NoReturn

import av
if TYPE_CHECKING:
import av


class Log:
Expand Down

0 comments on commit 11fb4d4

Please sign in to comment.