mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2024-11-15 17:10:46 +00:00
base renamed to vbancmd
misc renamed to event info message fixed if no events subbed to now using logging module in Event class
This commit is contained in:
parent
f46abedf12
commit
1169435104
@ -1,13 +1,19 @@
|
||||
import logging
|
||||
|
||||
|
||||
class Event:
|
||||
logger = logging.getLogger("event.event")
|
||||
|
||||
def __init__(self, subs: dict):
|
||||
self.subs = subs
|
||||
|
||||
def info(self, msg):
|
||||
info = (
|
||||
f"{msg} events",
|
||||
f"Now listening for {', '.join(self.get())} events",
|
||||
)
|
||||
print("\n".join(info))
|
||||
info = (f"{msg} events",)
|
||||
if self.any():
|
||||
info += (f"now listening for {', '.join(self.get())} events",)
|
||||
else:
|
||||
info += (f"not listening for any events",)
|
||||
self.logger.info(", ".join(info))
|
||||
|
||||
@property
|
||||
def pdirty(self):
|
@ -3,7 +3,7 @@ import time
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import Iterable, Optional, Union
|
||||
|
||||
from .misc import Event
|
||||
from .event import Event
|
||||
from .packet import RequestHeader
|
||||
from .subject import Subject
|
||||
from .util import Socket, comp, script
|
||||
@ -122,8 +122,8 @@ class VbanCmd(metaclass=ABCMeta):
|
||||
strip levels in PREFADER mode.
|
||||
"""
|
||||
return (
|
||||
tuple(val for val in packet.inputlevels),
|
||||
tuple(val for val in packet.outputlevels),
|
||||
tuple(((1 << 16) - 1) - val for val in packet.inputlevels),
|
||||
tuple(((1 << 16) - 1) - val for val in packet.outputlevels),
|
||||
)
|
||||
|
||||
def apply(self, data: dict):
|
Loading…
Reference in New Issue
Block a user