comparison sat/plugins/plugin_exp_command_export.py @ 4051:c23cad65ae99

core: renamed `messageReceived` trigger to `message_received`
author Goffi <goffi@goffi.org>
date Mon, 29 May 2023 13:32:08 +0200
parents 524856bd7b19
children
comparison
equal deleted inserted replaced
4050:199473ffe4ea 4051:c23cad65ae99
90 90
91 def __init__(self, host): 91 def __init__(self, host):
92 log.info(_("Plugin command export initialization")) 92 log.info(_("Plugin command export initialization"))
93 self.host = host 93 self.host = host
94 self.spawned = {} # key = entity 94 self.spawned = {} # key = entity
95 host.trigger.add("messageReceived", self.message_received_trigger, priority=10000) 95 host.trigger.add("message_received", self.message_received_trigger, priority=10000)
96 host.bridge.add_method( 96 host.bridge.add_method(
97 "command_export", 97 "command_export",
98 ".plugin", 98 ".plugin",
99 in_sign="sasasa{ss}s", 99 in_sign="sasasa{ss}s",
100 out_sign="", 100 out_sign="",
146 @param targets: list of allowed entities 146 @param targets: list of allowed entities
147 @param options: export options, a dict which can have the following keys ("true" to set booleans): 147 @param options: export options, a dict which can have the following keys ("true" to set booleans):
148 - exclusive: if set, skip all other triggers 148 - exclusive: if set, skip all other triggers
149 - loop: if set, restart the command once terminated #TODO 149 - loop: if set, restart the command once terminated #TODO
150 - pty: if set, launch in a pseudo terminal 150 - pty: if set, launch in a pseudo terminal
151 - continue: continue normal messageReceived handling 151 - continue: continue normal message_received handling
152 """ 152 """
153 client = self.host.get_client(profile_key) 153 client = self.host.get_client(profile_key)
154 for target in targets: 154 for target in targets:
155 try: 155 try:
156 _jid = jid.JID(target) 156 _jid = jid.JID(target)