mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2026-10-01 17:27:42 +00:00
Ruff: Fixed UP022
This commit is contained in:
+1
-1
@@ -66,7 +66,7 @@ indent-width = 4
|
|||||||
fixable = ['ALL']
|
fixable = ['ALL']
|
||||||
ignore = [
|
ignore = [
|
||||||
'FA100', #Add `from __future__ import annotations` to simplify `typing.Optional`
|
'FA100', #Add `from __future__ import annotations` to simplify `typing.Optional`
|
||||||
'UP022', # Prefer `capture_output` over sending `stdout` and `stderr` to `PIPE`
|
# 'UP022', # Prefer `capture_output` over sending `stdout` and `stderr` to `PIPE`
|
||||||
# 'SIM115', # Use a context manager for opening files
|
# 'SIM115', # Use a context manager for opening files
|
||||||
'UP031', #Use format specifiers instead of percent format
|
'UP031', #Use format specifiers instead of percent format
|
||||||
# 'C408', # Unnecessary `dict()` call (rewrite as a literal)
|
# 'C408', # Unnecessary `dict()` call (rewrite as a literal)
|
||||||
|
|||||||
+1
-2
@@ -1,14 +1,13 @@
|
|||||||
import json
|
import json
|
||||||
import os.path
|
import os.path
|
||||||
import subprocess
|
import subprocess
|
||||||
from subprocess import PIPE
|
|
||||||
|
|
||||||
FFPROBE = "ffprobe"
|
FFPROBE = "ffprobe"
|
||||||
|
|
||||||
|
|
||||||
def ffprobe(path):
|
def ffprobe(path):
|
||||||
arguments = [FFPROBE, "-of", "json", "-show_format", "-show_streams", path]
|
arguments = [FFPROBE, "-of", "json", "-show_format", "-show_streams", path]
|
||||||
process = subprocess.run(arguments, stdin=None, stdout=PIPE, stderr=PIPE, check=True)
|
process = subprocess.run(arguments, check=True, capture_output=True)
|
||||||
if process.returncode == 0:
|
if process.returncode == 0:
|
||||||
output_str = process.stdout.decode("utf-8")
|
output_str = process.stdout.decode("utf-8")
|
||||||
return json.loads(output_str)
|
return json.loads(output_str)
|
||||||
|
|||||||
Reference in New Issue
Block a user