tslumd.sender
¶
-
tslumd.sender.
Client
¶ A network client as a tuple of
(address, port)
alias of Tuple[str, int]
-
class
tslumd.sender.
UmdSender
(*args, **kwargs)[source]¶ Bases:
pydispatch.dispatch.Dispatcher
Send UMD Messages
Messages are sent immediately when a change is made to any of the
Tally
objects intallies
. These can be added by using theadd_tally()
method.Alternatively, the
set_tally_color()
andset_tally_text()
methods may be used.- Parameters
clients – Intitial value for
clients
-
broadcast_screen
: tslumd.tallyobj.Screen¶ A
Screen
instance created usingScreen.broadcast()
New in version 0.0.3.
-
screens
: Dict[int, tslumd.tallyobj.Screen]¶ Mapping of
Screen
objects byindex
New in version 0.0.3.
-
tallies
: Dict[Tuple[int, int], tslumd.tallyobj.Tally]¶ Mapping of
Tally
objects by theirid
Note
This should not be altered directly. Use
add_tally()
instead
-
loop
: asyncio.base_events.BaseEventLoop¶ The
asyncio.BaseEventLoop
associated with the instance
-
async
send_scontrol
(screen_index: int, data: bytes)[source]¶ Send an
SCONTROL
message- Parameters
New in version 0.0.2.
-
async
send_broadcast_scontrol
(data: bytes)[source]¶ Send a
broadcast
SCONTROL
message- Parameters
data – The data to send in the
scontrol
field
New in version 0.0.2.
-
add_tally
(tally_id: Tuple[int, int], **kwargs) → tslumd.tallyobj.Tally[source]¶ Create a
Tally
object and add it totallies
if one does not existIf necessary, creates a
Screen
usingget_or_create_screen()
- Parameters
tally_id – A tuple of (
screen_index
,tally_index
)**kwargs – Keyword arguments passed to create the tally instance
- Raises
KeyError – If the given
tally_id
already exists
Changed in version 0.0.3: Chaned the
tally_index
parameter totally_id
-
get_or_create_tally
(tally_id: Tuple[int, int]) → tslumd.tallyobj.Tally[source]¶ If a
Tally
object matching the given tally id exists, return it. Otherwise, create it usingScreen.get_or_create_tally()
This method is similar to
add_tally()
and it can be used to avoid exception handling. It does not however take keyword arguments and is only intended for object creation.New in version 0.0.3.
-
get_or_create_screen
(index_: int) → tslumd.tallyobj.Screen[source]¶ Create a
Screen
object and add it toscreens
- Parameters
index – The screen
index
- Raises
KeyError – If the given
index_
already exists
New in version 0.0.3.
-
set_tally_color
(tally_id: Tuple[int, int], tally_type: tslumd.common.TallyType, color: tslumd.common.TallyColor)[source]¶ Set the tally color for the given index and tally type
- Parameters
tally_id – A tuple of (
screen_index
,tally_index
)tally_type – A member of
TallyType
specifying the tally lamp within the displaycolor – The member of
TallyColor
to set
Changed in version 0.0.3: Chaned the
tally_index
parameter totally_id
-
set_tally_text
(tally_id: Tuple[int, int], text: str)[source]¶ Set the tally text for the given id
- Parameters
tally_id – A tuple of (
screen_index
,tally_index
)text – The
text
to set
Changed in version 0.0.3: Chaned the
tally_index
parameter totally_id
-
async
send_tally_control
(tally_id: Tuple[int, int], data: bytes)[source]¶ Send
control
data for the given screen and tally index- Parameters
tally_id – A tuple of (
screen_index
,tally_index
)control – The control data to send
New in version 0.0.2.
Changed in version 0.0.3: Chaned the
tally_index
parameter totally_id
-
async
send_broadcast_tally_control
(screen_index: int, data: bytes, **kwargs)[source]¶ Send
control
data asbroadcast
to all listening displays- Parameters
screen_index – The screen
index
**kwargs – Additional keyword arguments to pass to the
Tally
constructor
New in version 0.0.2.
Changed in version 0.0.3: Added the screen_index parameter
-
async
send_broadcast_tally
(screen_index: int, **kwargs)[source]¶ Send a
broadcast
update to all listening displays- Parameters
screen_index – The screen
index
**kwargs – The keyword arguments to pass to the
Tally
constructor
New in version 0.0.2.
Changed in version 0.0.3: Added the screen_index parameter