本文整理汇总了Python中pp_show.Show.calculate_duration方法的典型用法代码示例。如果您正苦于以下问题:Python Show.calculate_duration方法的具体用法?Python Show.calculate_duration怎么用?Python Show.calculate_duration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pp_show.Show
的用法示例。
在下文中一共展示了Show.calculate_duration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: play
# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import calculate_duration [as 别名]
def play(self,end_callback,show_ready_callback, parent_kickback_signal,level,controls_list):
self.mon.newline(3)
self.mon.trace(self, self.show_params['show-ref'])
Show.base_play(self,end_callback,show_ready_callback,parent_kickback_signal, level,controls_list)
# unpack show parameters
reason,message,self.show_timeout = Show.calculate_duration(self,self.show_params['show-timeout'])
if reason=='error':
self.mon.err(self,'ShowTimeout has bad time: '+self.show_params['show-timeout'])
self.end('error','ShowTimeout has bad time: '+self.show_params['show-timeout'])
self.track_count_limit = int(self.show_params['track-count-limit'])
reason,message,self.interval = Show.calculate_duration (self, self.show_params['interval'])
if reason=='error':
self.mon.err(self,'Interval has bad time: '+self.show_params['interval'])
self.end('error','Interval has bad time: '+self.show_params['interval'])
if self.medialist.anon_length()==0 and self.show_params['type'] not in ('liveshow','artliveshow'):
self.mon.err(self,'No anonymous tracks in medialist ')
self.end('error','No anonymous tracks in medialist ')
# delete eggtimer started by the parent
if self.previous_shower is not None:
self.previous_shower.delete_eggtimer()
self.start_show()
示例2: play
# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import calculate_duration [as 别名]
def play(self, end_callback, show_ready_callback, parent_kickback_signal, level, controls_list):
""" displays the menu
end_callback - function to be called when the menu exits
show_ready_callback - callback when menu is ready to display (not used)
level is 0 when the show is top level (run from [start] or from show control)
parent_kickback_signal - not used other than it being passed to a show
"""
# need to instantiate the medialist here as not using gapshow
self.medialist = MediaList("ordered")
Show.base_play(self, end_callback, show_ready_callback, parent_kickback_signal, level, controls_list)
self.mon.trace(self, self.show_params["show-ref"])
# parse the show and track timeouts
reason, message, self.show_timeout = Show.calculate_duration(self, self.show_params["show-timeout"])
if reason == "error":
self.mon.err(self, "Show Timeout has bad time: " + self.show_params["show-timeout"])
self.end("error", "show timeout, bad time")
reason, message, self.track_timeout = Show.calculate_duration(self, self.show_params["track-timeout"])
if reason == "error":
self.mon.err(self, "Track Timeout has bad time: " + self.show_params["track-timeout"])
self.end("error", "track timeout, bad time")
# and delete eggtimer
if self.previous_shower is not None:
self.previous_shower.delete_eggtimer()
# and display the menu
self.do_menu_track()
示例3: play
# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import calculate_duration [as 别名]
def play(self,end_callback,show_ready_callback,parent_kickback_signal,level,controls_list):
""" starts the hyperlink show at start-track
end_callback - function to be called when the show exits
show_ready_callback - callback to get the previous track
level is 0 when the show is top level (run from [start] or from show control)
parent_kickback_signal - not used other than it being passed to a show
"""
# need to instantiate the medialist here as in gapshow done in derived class
self.medialist=MediaList('ordered')
Show.base_play(self,end_callback,show_ready_callback, parent_kickback_signal,level,controls_list)
self.mon.trace(self,self.show_params['show-ref'])
#parse the show and track timeouts
reason,message,self.show_timeout=Show.calculate_duration(self,self.show_params['show-timeout'])
if reason =='error':
self.mon.err(self,'Show Timeout has bad time: '+self.show_params['show-timeout'])
self.end('error','show timeout, bad time: '+self.show_params['show-timeout'])
reason,message,self.track_timeout=Show.calculate_duration(self,self.show_params['track-timeout'])
if reason=='error':
self.mon.err(self,'Track Timeout has bad time: '+self.show_params['track-timeout'])
self.end('error','track timeout, bad time: '+self.show_params['track-timeout'])
# and delete eggtimer
if self.previous_shower is not None:
self.previous_shower.delete_eggtimer()
self.do_first_track()
示例4: play
# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import calculate_duration [as 别名]
def play(self,end_callback,show_ready_callback,parent_kickback_signal,level,controls_list):
""" starts the hyperlink show at start-track
end_callback - function to be called when the show exits
show_ready_callback - callback to get previous show and track
level is 0 when the show is top level (run from [start] or from show control)
parent_kickback_signal is not used passed to subshow by base class as parent_kickback_signal
"""
# need to instantiate the medialist here as in gapshow done in derived class
self.medialist=MediaList('ordered')
Show.base_play(self,end_callback,show_ready_callback, parent_kickback_signal,level,controls_list)
#dummy as it gets passed down to subshow, however it isn't actuallly used.
self.controls_list=[]
self.mon.trace(self, self.show_params['show-ref'])
# read show destinations
self.first_track_ref=self.show_params['first-track-ref']
self.home_track_ref=self.show_params['home-track-ref']
self.timeout_track_ref=self.show_params['timeout-track-ref']
#parse the show and track timeouts
reason,message,self.show_timeout=Show.calculate_duration(self,self.show_params['show-timeout'])
if reason =='error':
self.mon.err(self,'Show Timeout has bad time: '+self.show_params['show-timeout'])
self.end('error','show timeout, bad time: '+self.show_params['show-timeout'])
reason,message,self.track_timeout=Show.calculate_duration(self,self.show_params['track-timeout'])
if reason=='error':
self.mon.err(self,'Track Timeout has bad time: '+self.show_params['track-timeout'])
self.end('error','track timeout, bad time: ' +self.show_params['track-timeout'])
# and delete eggtimer
if self.previous_shower is not None:
self.previous_shower.delete_eggtimer()
self.do_first_track()