本文整理汇总了Python中pp_show.Show.write_stats方法的典型用法代码示例。如果您正苦于以下问题:Python Show.write_stats方法的具体用法?Python Show.write_stats怎么用?Python Show.write_stats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pp_show.Show
的用法示例。
在下文中一共展示了Show.write_stats方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: what_next_after_showing
# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import write_stats [as 别名]
def what_next_after_showing(self):
self.mon.trace(self, '')
# print 'WHAT NEXT AFTER SHOWING'
# print 'current is',self.mon.id(self.current_player), ' next track signal ',self.next_track_signal
# need to terminate
if self.terminate_signal is True:
self.terminate_signal=False
# what to do when closed or unloaded
self.ending_reason='killed'
Show.base_close_or_unload(self)
elif self.req_next== 'error':
self.req_next=''
# set what to do after closed or unloaded
self.ending_reason='error'
Show.base_close_or_unload(self)
# show timeout
elif self.show_timeout_signal is True:
self.show_timeout_signal=False
# what to do when closed or unloaded
self.ending_reason='show-timeout'
Show.base_close_or_unload(self)
# used by exit for stopping show from other shows.
elif self.exit_signal is True:
self.exit_signal=False
self.ending_reason='exit'
Show.base_close_or_unload(self)
# user wants to stop
elif self.user_stop_signal is True:
self.user_stop_signal=False
self.ending_reason='user-stop'
Show.base_close_or_unload(self)
# user has selected another track
elif self.next_track_signal is True:
self.next_track_signal=False
self.current_track_ref=self.next_track_arg
# print 'what next - next track signal is True so load ', self.current_track_ref
index = self.medialist.index_of_track(self.current_track_ref)
if index >=0:
# don't use select the track as not using selected_track in radiobuttonshow
# and load it
Show.write_stats(self,'play',self.show_params,self.medialist.track(index))
self.start_load_show_loop(self.medialist.track(index))
else:
self.mon.err(self,"track reference not found in medialist: "+ self.current_track_ref)
self.end('error',"track reference not found in medialist: "+ self.current_track_ref)
else:
# track ends naturally or is quit so go back to first track
# print 'what next - natural end so do first track'
self.do_first_track()
示例2: what_next_after_showing
# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import write_stats [as 别名]
def what_next_after_showing(self):
self.mon.trace(self,'')
# cancel track timeout timer
if self.track_timeout_timer is not None:
self.canvas.after_cancel(self.track_timeout_timer)
self.track_timeout_timer=None
# need to terminate?
if self.terminate_signal is True:
self.terminate_signal=False
# set what to do when closed or unloaded
self.ending_reason='killed'
Show.base_close_or_unload(self)
elif self.req_next== 'error':
self.req_next=''
# set what to do after closed or unloaded
self.ending_reason='error'
Show.base_close_or_unload(self)
# show timeout
elif self.show_timeout_signal is True:
self.show_timeout_signal=False
# set what to do when closed or unloaded
self.ending_reason='show-timeout'
Show.base_close_or_unload(self)
# used by exit for stopping show from other shows.
elif self.exit_signal is True:
self.exit_signal=False
self.ending_reason='exit'
Show.base_close_or_unload(self)
# user wants to stop
elif self.user_stop_signal is True:
self.user_stop_signal=False
self.ending_reason='user-stop'
Show.base_close_or_unload(self)
elif self.next_track_signal is True:
self.next_track_signal=False
self.menu_showing=False
# start timeout for the track if required
if self.track_timeout != 0:
self.track_timeout_timer=self.canvas.after(self.track_timeout*1000,self.track_timeout_callback)
self.last_menu_index=self.menu_index
Show.write_stats(self,'play',self.show_params,self.next_track)
self.start_load_show_loop(self.next_track)
else:
# no stopping the show required so re-display the menu
self.do_menu_track()
示例3: what_next_after_showing
# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import write_stats [as 别名]
def what_next_after_showing(self):
# print 'WHAT NEXT'
self.mon.trace(self,self.pretty_what_next_after_showing_state())
self.track_count+=1
# set false when child rack is to be played
self.enable_hint=True
# first of all deal with conditions that do not require the next track to be shown
# some of the conditions can happen at any time, others only when a track is closed or at pause_at_end
# need to terminate
if self.terminate_signal is True:
self.terminate_signal=False
self.stop_timers()
# set what to do after closed or unloaded
self.ending_reason='killed'
Show.base_close_or_unload(self)
elif self.error_signal== True or self.req_next=='error':
self.error_signal=False
self.req_next=''
self.stop_timers()
# set what to do after closed or unloaded
self.ending_reason='error'
Show.base_close_or_unload(self)
# used for exiting show from other shows, time of day, external etc.
elif self.exit_signal is True:
self.exit_signal=False
self.stop_timers()
self.ending_reason='exit'
Show.base_close_or_unload(self)
# show timeout
elif self.show_timeout_signal is True:
self.show_timeout_signal=False
self.stop_timers()
self.ending_reason='user-stop'
Show.base_close_or_unload(self)
# user wants to stop the show
elif self.user_stop_signal is True:
self.user_stop_signal=False
# print 'user stop'
self.stop_timers()
self.ending_reason='user-stop'
Show.base_close_or_unload(self)
# interval > 0. If last track has finished we are waiting for interval timer before ending the list
# note: if medialist finishes after interval is up then this route is used to start trigger.
elif self.waiting_for_interval is True:
# interval_timer_signal set by alarm clock started in start_list
if self.interval_timer_signal is True:
self.interval_timer_signal=False
self.waiting_for_interval=False
# print 'RECEIVED INTERVAL TIMER SIGNAL'
if self.show_params['repeat']=='repeat':
self.wait_for_trigger()
else:
self.stop_timers()
self.ending_reason='user-stop'
Show.base_close_or_unload(self)
else:
self.poll_for_interval_timer=self.canvas.after(1000,self.what_next_after_showing)
else:
self.medialist.create_new_livelist()
escapetrack_required=self.escapetrack_required
self.escapetrack_required=False
# print escapetrack_required,self.medialist.new_length()
if escapetrack_required is True and self.medialist.new_length() == 0:
# print 'use escape track'
index = self.medialist.index_of_track(self.show_params['escape-track-ref'])
self.mon.log(self,'Starting Escape Track: '+ self.show_params['escape-track-ref'])
if index >=0:
# don't use select the track as need to preserve mediashow sequence for returning from esacpe track
escape_track=self.medialist.track(index)
Show.write_stats(self,'play escape track',self.show_params,escape_track)
self.display_eggtimer()
# use new empty livelist so if changed works OK when return from empty track
self.medialist.use_new_livelist()
self.start_load_show_loop(escape_track)
else:
self.mon.err(self,"Escape Track empty")
self.end('error',"Escape Track empty")
# print 'FOR IF CHANGED',self.first_list,self.medialist.length(),self.medialist.new_length(),self.medialist.livelist_changed()
elif self.first_list is True or self.medialist.livelist_changed() is True or (self.medialist.length() == 0 and self.medialist.new_length() == 0):
if self.first_list is False:
# do show control
if self.medialist.length() == 0 and self.medialist.new_length() != 0:
# print 'show control empty to not empty'
# do show control when goes from not empty to empty only
self.show_control(self.show_params['show-control-not-empty'])
elif self.medialist.length() != 0 and self.medialist.new_length() == 0:
# print 'show control not empty to empty'
#.........这里部分代码省略.........
示例4: what_next_after_showing
# 需要导入模块: from pp_show import Show [as 别名]
# 或者: from pp_show.Show import write_stats [as 别名]
#.........这里部分代码省略.........
# repeat is return by 1
elif self.next_track_op in ('repeat'):
# print 'current', self.current_track_ref
# print 'home', self.home_track_ref
self.path.pop_for_sibling()
self.next_track_ref=self.current_track_ref
self.path.append(self.current_track_ref)
self.continue_timeout=True
if self.debug: print 'Executed Repeat ' + self.path.pretty_path()
# return-to
elif self.next_track_op in ('return-to'):
# back to one before return-to track
back_ref=self.path.back_to(self.next_track_arg)
if back_ref == '':
self.mon.err(self,"return-to - track not in path: "+self.next_track_arg)
self.end('error',"return-to - track not in path: "+self.next_track_arg)
# and append the return to track
self.next_track_ref=self.next_track_arg
self.path.append(self.next_track_ref)
if self.debug: print 'Executed Return To' + self.next_track_arg + self.path.pretty_path()
# call
elif self.next_track_op in ('call'):
# append the required track
self.path.append(self.next_track_arg)
self.next_track_ref=self.next_track_arg
if self.debug: print 'Executed Call ' + self.next_track_arg + self.path.pretty_path()
# goto
elif self.next_track_op in ('goto'):
self.path.empty()
# add the goto track
self.next_track_ref=self.next_track_arg
self.path.append(self.next_track_arg)
if self.debug: print 'Executed Goto ' + self.next_track_arg + self.path.pretty_path()
# jump
elif self.next_track_op in ('jump'):
# back to home and remove it
back_ref=self.path.back_to(self.home_track_ref)
if back_ref == '':
self.mon.err(self,"jump - home track not in path: "+self.home_track_ref)
self.end('error',"jump - track not in path: "+self.home_track_ref)
# add back the home track without playing it
self.path.append(self.home_track_ref)
# append the jumped to track
self.next_track_ref=self.next_track_arg
self.path.append(self.next_track_ref)
if self.debug: print 'Executed Jump ' + self.next_track_arg + self.path.pretty_path()
else:
self.mon.err(self,"unaddressed what next: "+ self.next_track_op+ ' '+self.next_track_arg)
self.end('error',"unaddressed what next: " + self.next_track_op+ ' '+self.next_track_arg)
self.current_track_ref=self.next_track_ref
index = self.medialist.index_of_track(self.next_track_ref)
if index >=0:
Show.write_stats(self,self.next_track_op,self.show_params,self.medialist.track(index))
# don't use select the track as not using selected_track in hyperlinkshow
self.start_load_show_loop(self.medialist.track(index))
else:
self.mon.err(self,"next-track not found in medialist: "+ self.next_track_ref)
self.end('error',"next track not found in medialist: "+ self.next_track_ref)
else:
# track ends naturally look to see if there is a pp-onend link
found,link_op,link_arg=self.path.find_link('pp-onend',self.links)
if found is True:
if link_op=='exit':
self.user_stop_signal=True
self.current_player.input_pressed('stop')
self.what_next_after_showing()
elif link_op == 'home':
self.decode_home()
self.what_next_after_showing()
elif link_op == 'return':
self.decode_return(link_arg)
self.what_next_after_showing()
elif link_op == 'call':
self.decode_call(link_arg)
self.what_next_after_showing()
elif link_op == 'goto':
self.decode_goto(link_arg)
self.what_next_after_showing()
elif link_op == 'jump':
self.decode_jump(link_arg)
self.what_next_after_showing()
elif link_op == 'repeat':
self.decode_repeat()
self.what_next_after_showing()
else:
self.mon.err(self,"unknown link command for pp_onend: "+ link_op)
self.end('error',"unkown link command for pp-onend: "+ link_op)
else:
if self.show_params['disable-controls']!='yes':
self.mon.err(self,"pp-onend for this track not found: "+ link_op)
self.end('error',"pp-onend for this track not found: "+ link_op)