Linting with ruff.
This commit is contained in:
+4
-5
@@ -6,18 +6,17 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from functools import cmp_to_key
|
from functools import cmp_to_key
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import coloredlogs
|
import coloredlogs
|
||||||
|
|
||||||
from tscut.exceptions import TSCutError
|
|
||||||
from tscut.config import ProcessingOptions
|
from tscut.config import ProcessingOptions
|
||||||
from tscut.tools.discovery import check_required_tools
|
from tscut.exceptions import TSCutError
|
||||||
from tscut.tools.timeframe import parse_time_interval, compare_time_interval
|
|
||||||
from tscut.pipeline import process_recording
|
from tscut.pipeline import process_recording
|
||||||
|
from tscut.tools.discovery import check_required_tools
|
||||||
|
from tscut.tools.timeframe import compare_time_interval, parse_time_interval
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -3,8 +3,9 @@
|
|||||||
# Copyright (C) 2026 Frédéric Tronel
|
# Copyright (C) 2026 Frédéric Tronel
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from pathlib import Path
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class ProcessingOptions:
|
class ProcessingOptions:
|
||||||
|
|||||||
@@ -8,26 +8,24 @@ from dataclasses import dataclass, field
|
|||||||
from math import floor
|
from math import floor
|
||||||
from typing import IO
|
from typing import IO
|
||||||
|
|
||||||
|
|
||||||
from typeguard import typechecked
|
|
||||||
import hexdump
|
import hexdump
|
||||||
|
from typeguard import typechecked
|
||||||
|
|
||||||
from tscut.h264.bitstream import (
|
from tscut.h264.bitstream import (
|
||||||
|
rbsp_to_sodb,
|
||||||
read_bit,
|
read_bit,
|
||||||
read_bits,
|
read_bits,
|
||||||
read_byte,
|
read_byte,
|
||||||
read_long,
|
read_long,
|
||||||
read_word,
|
read_word,
|
||||||
|
sodb_to_rbsp,
|
||||||
write_bits,
|
write_bits,
|
||||||
write_byte,
|
write_byte,
|
||||||
write_word,
|
write_word,
|
||||||
sodb_to_rbsp,
|
|
||||||
rbsp_to_sodb
|
|
||||||
)
|
)
|
||||||
|
|
||||||
from tscut.h264.parameters import (
|
from tscut.h264.parameters import (
|
||||||
SPS,
|
|
||||||
PPS,
|
PPS,
|
||||||
|
SPS,
|
||||||
)
|
)
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
import logging
|
import logging
|
||||||
from math import floor, log
|
from math import floor, log
|
||||||
|
|
||||||
from typeguard import typechecked
|
|
||||||
import hexdump
|
import hexdump
|
||||||
|
from typeguard import typechecked
|
||||||
|
|
||||||
from tscut.exceptions import UnimplementedFeatureError
|
from tscut.exceptions import UnimplementedFeatureError
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,15 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from math import floor, log, ceil
|
from math import ceil, floor, log
|
||||||
|
|
||||||
from typeguard import typechecked
|
|
||||||
import hexdump
|
import hexdump
|
||||||
|
from typeguard import typechecked
|
||||||
|
|
||||||
from tscut.h264.bitstream import (
|
from tscut.h264.bitstream import (
|
||||||
|
more_rbsp_data,
|
||||||
|
parse_rbsp_trailing_bits,
|
||||||
|
parse_scaling_list,
|
||||||
read_bit,
|
read_bit,
|
||||||
read_bits,
|
read_bits,
|
||||||
read_boolean,
|
read_boolean,
|
||||||
@@ -28,9 +31,6 @@ from tscut.h264.bitstream import (
|
|||||||
write_signed_exp_golomb,
|
write_signed_exp_golomb,
|
||||||
write_unsigned_exp_golomb,
|
write_unsigned_exp_golomb,
|
||||||
write_word,
|
write_word,
|
||||||
parse_scaling_list,
|
|
||||||
parse_rbsp_trailing_bits,
|
|
||||||
more_rbsp_data
|
|
||||||
)
|
)
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -6,15 +6,12 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import IO
|
from typing import IO
|
||||||
|
|
||||||
from typeguard import typechecked
|
|
||||||
import hexdump
|
import hexdump
|
||||||
|
from typeguard import typechecked
|
||||||
|
|
||||||
from tscut.matroska.ebml import get_ebml_length
|
|
||||||
from tscut.h264.avc import (
|
|
||||||
AVCDecoderConfiguration,
|
|
||||||
get_avc_config_from_h264
|
|
||||||
)
|
|
||||||
from tscut.exceptions import InvalidMediaError
|
from tscut.exceptions import InvalidMediaError
|
||||||
|
from tscut.h264.avc import AVCDecoderConfiguration, get_avc_config_from_h264
|
||||||
|
from tscut.matroska.ebml import get_ebml_length
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ from os import (
|
|||||||
)
|
)
|
||||||
from typing import IO
|
from typing import IO
|
||||||
|
|
||||||
from typeguard import typechecked
|
|
||||||
import hexdump
|
import hexdump
|
||||||
|
from typeguard import typechecked
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
+17
-31
@@ -2,55 +2,41 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2026 Frédéric Tronel
|
# Copyright (C) 2026 Frédéric Tronel
|
||||||
|
|
||||||
from datetime import datetime, timedelta
|
import logging
|
||||||
import os
|
import os
|
||||||
|
from datetime import datetime, timedelta
|
||||||
from os import unlink
|
from os import unlink
|
||||||
from shutil import copyfile, move
|
from shutil import copyfile, move
|
||||||
from sys import exit
|
from sys import exit
|
||||||
import logging
|
|
||||||
from typing import IO, Any, BinaryIO
|
from typing import IO, Any, BinaryIO
|
||||||
|
|
||||||
import hexdump
|
import hexdump
|
||||||
|
|
||||||
from tscut.exceptions import InvalidMediaError
|
|
||||||
from tscut.config import ProcessingOptions
|
from tscut.config import ProcessingOptions
|
||||||
from tscut.tools.mkvtoolnix import (
|
from tscut.exceptions import InvalidMediaError
|
||||||
get_codec_private_data_from_mkv,
|
from tscut.h264.avc import get_avc_config_from_h264, parse_codec_private
|
||||||
change_codec_private_data,
|
from tscut.matroska.codec import dump_codec_private_data
|
||||||
extract_mkv_part,
|
from tscut.subtitles.ocr import do_ocr, extract_srt, get_tesseract_supported_lang
|
||||||
extract_track_from_mkv,
|
from tscut.tools.ffmpeg import extract_all_streams, ffmpeg_convert
|
||||||
merge_mkvs,
|
|
||||||
remove_video_tracks_from_mkv,
|
|
||||||
remux_srt_subtitles
|
|
||||||
)
|
|
||||||
from tscut.tools.ffmpeg import (
|
|
||||||
ffmpeg_convert,
|
|
||||||
extract_all_streams
|
|
||||||
)
|
|
||||||
from tscut.tools.ffprobe import (
|
from tscut.tools.ffprobe import (
|
||||||
find_subtitles_tracks,
|
find_subtitles_tracks,
|
||||||
get_format,
|
get_format,
|
||||||
get_frame_rate,
|
get_frame_rate,
|
||||||
get_movie_duration,
|
get_movie_duration,
|
||||||
get_nearest_iframe,
|
get_nearest_iframe,
|
||||||
get_streams
|
get_streams,
|
||||||
)
|
)
|
||||||
from tscut.h264.avc import (
|
from tscut.tools.mkvtoolnix import (
|
||||||
parse_codec_private,
|
change_codec_private_data,
|
||||||
get_avc_config_from_h264
|
extract_mkv_part,
|
||||||
)
|
extract_track_from_mkv,
|
||||||
from tscut.matroska.codec import dump_codec_private_data
|
get_codec_private_data_from_mkv,
|
||||||
from tscut.tscut import (
|
merge_mkvs,
|
||||||
concatenate_h264_parts,
|
remove_video_tracks_from_mkv,
|
||||||
concatenate_h264_ts_parts,
|
remux_srt_subtitles,
|
||||||
SupportedFormat
|
|
||||||
)
|
|
||||||
from tscut.subtitles.ocr import (
|
|
||||||
do_ocr,
|
|
||||||
extract_srt,
|
|
||||||
get_tesseract_supported_lang
|
|
||||||
)
|
)
|
||||||
from tscut.tools.timeframe import get_ts_frame
|
from tscut.tools.timeframe import get_ts_frame
|
||||||
|
from tscut.tscut import SupportedFormat, concatenate_h264_parts, concatenate_h264_ts_parts
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -4,26 +4,25 @@
|
|||||||
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import IO, Sequence
|
import os
|
||||||
from io import TextIOWrapper
|
import re
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
from io import TextIOWrapper
|
||||||
from os import (
|
from os import (
|
||||||
read,
|
|
||||||
SEEK_SET,
|
SEEK_SET,
|
||||||
|
fstat,
|
||||||
lseek,
|
lseek,
|
||||||
memfd_create,
|
memfd_create,
|
||||||
|
read,
|
||||||
write,
|
write,
|
||||||
fstat,
|
|
||||||
)
|
)
|
||||||
import re
|
|
||||||
import os
|
|
||||||
from subprocess import PIPE, Popen
|
from subprocess import PIPE, Popen
|
||||||
from typing import IO, Any
|
from typing import IO, Any, Sequence
|
||||||
|
|
||||||
from iso639 import Lang
|
from iso639 import Lang
|
||||||
from iso639.exceptions import InvalidLanguageValue
|
from iso639.exceptions import InvalidLanguageValue
|
||||||
from typeguard import typechecked
|
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
from typeguard import typechecked
|
||||||
|
|
||||||
from tscut.exceptions import ExternalToolError
|
from tscut.exceptions import ExternalToolError
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ from typing import IO
|
|||||||
|
|
||||||
from typeguard import typechecked
|
from typeguard import typechecked
|
||||||
|
|
||||||
from tscut.tools.timeframe import get_ts_frame
|
|
||||||
from tscut.exceptions import InvalidMediaError
|
from tscut.exceptions import InvalidMediaError
|
||||||
|
from tscut.tools.timeframe import get_ts_frame
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -4,29 +4,22 @@
|
|||||||
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from io import TextIOWrapper
|
import os
|
||||||
import re
|
import re
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from os import (
|
from io import TextIOWrapper
|
||||||
read,
|
from os import SEEK_SET, fstat, ftruncate, lseek, read, set_inheritable, write
|
||||||
SEEK_SET,
|
|
||||||
lseek,
|
|
||||||
write,
|
|
||||||
fstat,
|
|
||||||
set_inheritable,
|
|
||||||
ftruncate
|
|
||||||
)
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from subprocess import PIPE, Popen
|
from subprocess import PIPE, Popen
|
||||||
from typing import IO
|
from typing import IO
|
||||||
|
|
||||||
from typeguard import typechecked
|
|
||||||
import hexdump
|
import hexdump
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
from typeguard import typechecked
|
||||||
|
|
||||||
from tscut.matroska.ebml import change_ebml_element_size
|
|
||||||
from tscut.exceptions import InvalidMediaError
|
from tscut.exceptions import InvalidMediaError
|
||||||
|
from tscut.matroska.ebml import change_ebml_element_size
|
||||||
|
|
||||||
|
|
||||||
# Found codec private data using mkvinfo
|
# Found codec private data using mkvinfo
|
||||||
@typechecked
|
@typechecked
|
||||||
|
|||||||
Reference in New Issue
Block a user