Skip to content

Commit 5af8f48

Browse files
committed
Make the linter happy
1 parent 5fbbe6e commit 5af8f48

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

auto_editor/lang/palet.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,9 @@ def __init__(self, syn: Callable[[Env, list], Any]):
754754
def __call__(self, env: Env, node: list) -> Any:
755755
return self.syn(env, node)
756756

757-
__str__: Callable[[Syntax], str] = lambda self: "#<syntax>"
757+
def __str__(self) -> str:
758+
return "#<syntax>"
759+
758760
__repr__ = __str__
759761

760762

auto_editor/lib/data_structs.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from fractions import Fraction
44
from io import StringIO
5-
from typing import Callable
65

76
import numpy as np
87

@@ -14,7 +13,9 @@ def __init__(self, val: str):
1413
self.val = val
1514
self.hash = hash(val)
1615

17-
__str__: Callable[[Sym], str] = lambda self: self.val
16+
def __str__(self) -> str:
17+
return self.val
18+
1819
__repr__ = __str__
1920

2021
def __hash__(self) -> int:
@@ -34,7 +35,8 @@ def __init__(self, val: str | int):
3435
assert type(val) is str and len(val) == 1
3536
self.val = val
3637

37-
__str__: Callable[[Char], str] = lambda self: self.val
38+
def __str__(self) -> str:
39+
return self.val
3840

3941
def __repr__(self) -> str:
4042
names = {" ": "space", "\n": "newline", "\t": "tab"}

auto_editor/render/audio.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from auto_editor.utils.cmdkw import ParserError, parse_with_palet, pAttr, pAttrs
1818
from auto_editor.utils.log import Log
1919
from auto_editor.utils.types import Args
20-
from auto_editor.wavfile import AudioData, WavError, read, write
20+
from auto_editor.wavfile import AudioData, read, write
2121

2222
# only newer versions of ffmpeg support lra to 50.
2323
# Ubuntu Latest and my static ffmpeg build for Windows are the main blockers
@@ -182,10 +182,10 @@ def make_new_audio(
182182
if not tl.a or not tl.a[0]:
183183
log.error("Trying to render empty audio timeline")
184184

185-
for l, layer in enumerate(tl.a):
185+
for i, layer in enumerate(tl.a):
186186
bar.start(len(layer), "Creating new audio")
187187

188-
path = Path(temp, f"new{l}.wav")
188+
path = Path(temp, f"new{i}.wav")
189189
output.append(f"{path}")
190190
arr: AudioData | None = None
191191

@@ -255,10 +255,7 @@ def make_new_audio(
255255
write(fid, sr, samp_list[samp_start:samp_end])
256256

257257
ffmpeg.run(["-i", f"{af}", "-af", ",".join(filters), f"{af_out}"])
258-
try:
259-
clip_arr = read(f"{af_out}")[1]
260-
except WavError as e:
261-
raise e
258+
clip_arr = read(f"{af_out}")[1]
262259

263260
# Mix numpy arrays
264261
start = clip.start * sr // tb

0 commit comments

Comments
 (0)