diff --git a/vban_cmd/misc.py b/vban_cmd/event.py similarity index 66% rename from vban_cmd/misc.py rename to vban_cmd/event.py index f913157..5711905 100644 --- a/vban_cmd/misc.py +++ b/vban_cmd/event.py @@ -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): diff --git a/vban_cmd/base.py b/vban_cmd/vbancmd.py similarity index 96% rename from vban_cmd/base.py rename to vban_cmd/vbancmd.py index bb32707..6c23310 100644 --- a/vban_cmd/base.py +++ b/vban_cmd/vbancmd.py @@ -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):