1 from __future__
import division, absolute_import
3 from twistedActor
import CommandError
7 def talk(tccActor, userCmd):
8 """Implement the talk command
10 @param[in,out] tccActor tcc actor
11 @param[in,out] userCmd user command
13 devName = userCmd.parsedCmd.paramDict[
"device"].valueList[0]
14 cmdStr = userCmd.parsedCmd.paramDict[
"command"].valueList[0]
16 timeLimQual = userCmd.parsedCmd.qualDict[
"timelimit"]
17 if timeLimQual.boolValue:
18 argDict[
"timeLim"] = timeLimQual.valueList[0]
20 lowDevName = devName.lower()
21 if lowDevName
in tccActor.axisDevSet:
23 axisDev = tccActor.axisDevSet[lowDevName]
24 axisDev.startCmd(cmdStr, userCmd=userCmd, showReplies=
True, **argDict)
25 elif lowDevName
in tccActor.mirDevSet:
27 mirDev = tccActor.mirDevSet[lowDevName]
28 mirDev.startCmd(cmdStr, userCmd=userCmd, showReplies=
True, **argDict)
30 raise CommandError(
"Unknown device %r" % (devName,))