reformat long arrays

fix long multi line arrays created by black
This commit is contained in:
onyx-and-iris 2022-03-27 11:33:01 +01:00
parent 2e23a03b32
commit 6c2fb720f2
3 changed files with 22 additions and 181 deletions

View File

@ -11,19 +11,13 @@ VMKind = namedtuple("VMKind", ["id", "name", "ins", "outs", "executable", "vban"
bits = 64 if sys.maxsize > 2**32 else 32 bits = 64 if sys.maxsize > 2**32 else 32
os = platform.system() os = platform.system()
# fmt: off
_kind_map = { _kind_map = {
"basic": VMKind("basic", "Basic", (2, 1), (1, 1), "voicemeeter.exe", (4, 4)), "basic": VMKind("basic", "Basic", (2, 1), (1, 1), "voicemeeter.exe", (4, 4)),
"banana": VMKind("banana", "Banana", (3, 2), (3, 2), "voicemeeterpro.exe", (8, 8)), "banana": VMKind("banana", "Banana", (3, 2), (3, 2), "voicemeeterpro.exe", (8, 8)),
"potato": VMKind( "potato": VMKind("potato", "Potato", (5, 3), (5, 3), f'voicemeeter8{"x64" if bits == 64 else ""}.exe', (8, 8),),
"potato",
"Potato",
(5, 3),
(5, 3),
f'voicemeeter8{"x64" if bits == 64 else ""}.exe',
(8, 8),
),
} }
# fmt: on
def get(kind_id): def get(kind_id):

View File

@ -73,177 +73,45 @@ def strip_output_prop(param):
def bus_mode_prop(param): def bus_mode_prop(param):
"""A bus mode prop.""" """A bus mode prop."""
# fmt: off
def fget(self): def fget(self):
data = self.public_packet data = self.public_packet
modes = { modes = {
"normal": ( "normal": (
False, False, False, False, False, False, False, False, False, False, False, False, False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
False,
), ),
"amix": ( "amix": (
False, False, True, False, True, False, True, False, True, False, True, False, True,
True,
False,
True,
False,
True,
False,
True,
False,
True,
False,
True,
), ),
"repeat": ( "repeat": (
False, False, False, True, True, False, False, True, True, False, False, True, True,
False,
True,
True,
False,
False,
True,
True,
False,
False,
True,
True,
), ),
"bmix": ( "bmix": (
False, False, True, True, True, False, True, True, True, False, True, True, True,
True,
True,
True,
False,
True,
True,
True,
False,
True,
True,
True,
), ),
"composite": ( "composite": (
False, False, False, False, False, True, True, True, True, False, False, False, False,
False,
False,
False,
True,
True,
True,
True,
False,
False,
False,
False,
), ),
"tvmix": ( "tvmix": (
False, False, True, False, True, True, True, True, True, False, True, False, True,
True,
False,
True,
True,
True,
True,
True,
False,
True,
False,
True,
), ),
"upmix21": ( "upmix21": (
False, False, False, True, True, True, True, True, True, False, False, True, True,
False,
True,
True,
True,
True,
True,
True,
False,
False,
True,
True,
), ),
"upmix41": ( "upmix41": (
False, False, True, True, True, True, True, True, True, False, True, True, True,
True,
True,
True,
True,
True,
True,
True,
False,
True,
True,
True,
), ),
"upmix61": ( "upmix61": (
False, False, False, False, False, False, False, False, False, True, True, True, True,
False,
False,
False,
False,
False,
False,
False,
True,
True,
True,
True,
), ),
"centeronly": ( "centeronly": (
False, False, True, False, True, False, True, False, True, True, True, True, True,
True,
False,
True,
False,
True,
False,
True,
True,
True,
True,
True,
), ),
"lfeonly": ( "lfeonly": (
False, False, False, True, True, False, False, True, True, True, True, True, True,
False,
True,
True,
False,
False,
True,
True,
True,
True,
True,
True,
), ),
"rearonly": ( "rearonly": (
False, False, True, True, True, False, True, True, True, True, True, True, True,
True,
True,
True,
False,
True,
True,
True,
True,
True,
True,
True,
), ),
} }
vals = tuple( vals = tuple(
@ -256,7 +124,7 @@ def bus_mode_prop(param):
self._remote.cache[f"{self.identifier}.mode.{param}"] = [val, False] self._remote.cache[f"{self.identifier}.mode.{param}"] = [val, False]
return val return val
return val == 1 return val == 1
# fmt: on
def fset(self, val): def fset(self, val):
if not isinstance(val, bool) and val not in (0, 1): if not isinstance(val, bool) and val not in (0, 1):
raise VMCMDErrors(f"mode.{param} is a boolean parameter") raise VMCMDErrors(f"mode.{param} is a boolean parameter")

View File

@ -29,34 +29,13 @@ class VbanCmd(abc.ABC):
self._channel = kwargs["channel"] self._channel = kwargs["channel"]
self._delay = kwargs["delay"] self._delay = kwargs["delay"]
self._ratelimiter = kwargs["ratelimiter"] self._ratelimiter = kwargs["ratelimiter"]
# fmt: off
self._bps_opts = [ self._bps_opts = [
0, 0, 110, 150, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 31250,
110, 38400, 57600, 115200, 128000, 230400, 250000, 256000, 460800, 921600,
150, 1000000, 1500000, 2000000, 3000000,
300,
600,
1200,
2400,
4800,
9600,
14400,
19200,
31250,
38400,
57600,
115200,
128000,
230400,
250000,
256000,
460800,
921600,
1000000,
1500000,
2000000,
3000000,
] ]
# fmt: on
if self._channel not in range(256): if self._channel not in range(256):
raise VMCMDErrors("Channel must be in range 0 to 255") raise VMCMDErrors("Channel must be in range 0 to 255")
self._text_header = TextRequestHeader( self._text_header = TextRequestHeader(