本文整理汇总了Python中interpreter.Interpreter.buildPlay方法的典型用法代码示例。如果您正苦于以下问题:Python Interpreter.buildPlay方法的具体用法?Python Interpreter.buildPlay怎么用?Python Interpreter.buildPlay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类interpreter.Interpreter
的用法示例。
在下文中一共展示了Interpreter.buildPlay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Modem
# 需要导入模块: from interpreter import Interpreter [as 别名]
# 或者: from interpreter.Interpreter import buildPlay [as 别名]
#.........这里部分代码省略.........
if self.status != Modem.Status.IDLE:
raise ValueError("Modem setPower unexpected status: \
" + str(self.status))
self.status = Modem.Status.BUSY2REQ
self.send(self.interpreter.buildSetPower(ID_list, s_l))
while self.status != Modem.Status.IDLE and self.status != Modem.Status.KILL:
sleep(self.m_to)
# self.recvCommand()
if self.status == Modem.Status.KILL:
return self.close()
return self.errorCheck()
def reqPlayProj(self, name, ID_list, starting_time, n_rip = 1, \
delete = 1, force_flag = 0):
"""
Transmit the file with the projector.
@param self pointer to the class object
@param name of the file that has to be played
@param ID_list list of the projector IDs where to play the file
@param starting_time Unix timestamp, in second, when to start playing the file
@param n_rip number of time it has to be consecutively played
@param delete flag, if 1 erase it after playing, if 0 not
@param force_flag if trying to transmit while recording:
0 (default) not allowed (error feedback)
1 (force) stop recording and start transmitting
2 (both) do both the operations together
"""
while self.status != Modem.Status.IDLE :
sleep(0.1)
if self.status != Modem.Status.IDLE:
raise ValueError("Modem playProj unexpected status: \
" + str(self.status))
self.status = Modem.Status.BUSY2REQ
self.send(self.interpreter.buildPlay(name, ID_list, starting_time, \
n_rip, delete, force_flag))
while self.status != Modem.Status.IDLE and self.status != Modem.Status.KILL:
sleep(self.m_to)
# self.recvCommand()
if self.status == Modem.Status.KILL:
return self.close()
return self.errorCheck()
def reqRunScript(self, script_name, output_name, starting_time, duration):
"""
Run a script in the node.
@param self pointer to the class object
@param script_name of the file that has to be run
@paran output_name where to redirect the output of the script
@param starting_time Unix timestamp, in second, when to start playing the file
@param duration in minutes of the script
"""
while self.status != Modem.Status.IDLE :
sleep(0.1)
if self.status != Modem.Status.IDLE:
raise ValueError("Modem reqRunScript unexpected status: \
" + str(self.status))
self.status = Modem.Status.BUSY2REQ
self.send(self.interpreter.buildRun(script_name, output_name, \
starting_time, duration))
while self.status != Modem.Status.IDLE and self.status != Modem.Status.KILL:
sleep(self.m_to)
#self.recvCommand()
if self.status == Modem.Status.KILL:
return self.close()
return self.errorCheck()