1 from __future__
import division, absolute_import
3 from collections
import OrderedDict
4 from RO.StringUtil
import quoteStr
7 __all__ = [
"broadcast"]
9 MsgTypeCodeDict = OrderedDict((
21 """Implement the broadcast command
23 @param[in] tccActor tcc actor
24 @param[in,out] userCmd a twistedActor BaseCommand with parseCmd attribute
27 msgStr = userCmd.parsedCmd.paramDict[
"message"].valueList[0]
28 msgType = userCmd.parsedCmd.qualDict[
"type"].valueList[0]
29 msgCode = MsgTypeCodeDict[msgType]
30 hubMsg =
"Broadcast=%s" % (quoteStr(msgStr,))
31 if msgCode
in msgCode
in RO.KeyVariable.DoneTypes:
33 tccActor.writeToUsers(msgCode, hubMsg, userID=userCmd.userID)
35 tccActor.writeToUsers(msgCode, hubMsg, cmd=userCmd)
36 if not userCmd.isDone:
37 userCmd.setState(userCmd.Done)