Skip to content

Commit

Permalink
Make the linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed May 26, 2023
1 parent 5fbbe6e commit 5af8f48
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 3 additions & 1 deletion auto_editor/lang/palet.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,9 @@ def __init__(self, syn: Callable[[Env, list], Any]):
def __call__(self, env: Env, node: list) -> Any:
return self.syn(env, node)

__str__: Callable[[Syntax], str] = lambda self: "#<syntax>"
def __str__(self) -> str:
return "#<syntax>"

__repr__ = __str__


Expand Down
8 changes: 5 additions & 3 deletions auto_editor/lib/data_structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from fractions import Fraction
from io import StringIO
from typing import Callable

import numpy as np

Expand All @@ -14,7 +13,9 @@ def __init__(self, val: str):
self.val = val
self.hash = hash(val)

__str__: Callable[[Sym], str] = lambda self: self.val
def __str__(self) -> str:
return self.val

__repr__ = __str__

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

__str__: Callable[[Char], str] = lambda self: self.val
def __str__(self) -> str:
return self.val

def __repr__(self) -> str:
names = {" ": "space", "\n": "newline", "\t": "tab"}
Expand Down
11 changes: 4 additions & 7 deletions auto_editor/render/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from auto_editor.utils.cmdkw import ParserError, parse_with_palet, pAttr, pAttrs
from auto_editor.utils.log import Log
from auto_editor.utils.types import Args
from auto_editor.wavfile import AudioData, WavError, read, write
from auto_editor.wavfile import AudioData, read, write

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

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

path = Path(temp, f"new{l}.wav")
path = Path(temp, f"new{i}.wav")
output.append(f"{path}")
arr: AudioData | None = None

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

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

# Mix numpy arrays
start = clip.start * sr // tb
Expand Down

0 comments on commit 5af8f48

Please sign in to comment.