本文整理汇总了Python中pp_medialist.MediaList类的典型用法代码示例。如果您正苦于以下问题:Python MediaList类的具体用法?Python MediaList怎么用?Python MediaList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MediaList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: play
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()
示例2: play
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()
示例3: play
def play(self,end_callback,ready_callback=None,top=False,command='nil'):
""" displays the menu
end_callback - function to be called when the menu exits
ready_callback - callback when menu is ready to display (not used)
top is True when the show is top level (run from [start])
"""
#instantiate arguments
self.end_callback=end_callback
self.ready_callback=ready_callback
self.top=top
self.command=command
# check data files are available.
self.menu_file = self.pp_profile + "/" + self.show['medialist']
if not os.path.exists(self.menu_file):
self.mon.err(self,"Medialist file not found: "+ self.menu_file)
self._end('error',"Medialist file not found")
#create a medialist for the menu and read it.
self.medialist=MediaList()
if self.medialist.open_list(self.menu_file,self.showlist.sissue()) == False:
self.mon.err(self,"Version of medialist different to Pi Presents")
self._end('error',"Version of medialist different to Pi Presents")
if self.show['has-background']=="yes":
background_index=self.medialist.index_of_track ('pp-menu-background')
if background_index>=0:
self.menu_img_file = self.complete_path(self.medialist.track(background_index))
if not os.path.exists(self.menu_img_file):
self.mon.err(self,"Menu background file not found: "+ self.menu_img_file)
self._end('error',"Menu background file not found")
else:
self.mon.err(self,"Menu background not found in medialist")
self._end('error',"Menu background not found")
#start timeout alarm if required
if int(self.show['timeout'])<>0:
self.menu_timeout_running=self.canvas.after(int(self.show['timeout'])*1000,self._timeout_menu)
if self.ready_callback<>None:
self.ready_callback()
self.canvas.delete(ALL)
# display background image
if self.show['has-background']=="yes":
self._display_background()
#display the list of video titles
self._display_video_titles()
# display instructions (hint)
self.canvas.create_text(int(self.canvas['width'])/2,
int(self.canvas['height']) - int(self.show['hint-y']),
text=self.show['hint-text'],
fill=self.show['hint-colour'],
font=self.show['hint-font'])
self.canvas.update( )
示例4: play
def play(self,show_id,end_callback,show_ready_callback, top=False,command='nil'):
""" displays the mediashow
end_callback - function to be called when the menu exits
ready_callback - callback when menu is ready to display (not used)
top is True when the show is top level (run from [start])
"""
#instantiate the arguments
self.show_id=show_id
self.end_callback=end_callback
self.show_ready_callback=show_ready_callback
self.top=top
self.command=command
self.mon.log(self,self.show_params['show-ref']+ ' '+ str(self.show_id)+ ": Starting show")
# check data files are available.
self.media_file = self.pp_profile + "/" + self.show_params['medialist']
if not os.path.exists(self.media_file):
self.mon.err(self,"Medialist file not found: "+ self.media_file)
self.end('error',"Medialist file not found")
#create a medialist for the mediashow and read it.
self.medialist=MediaList(self.show_params['sequence'])
if self.medialist.open_list(self.media_file,self.showlist.sissue())==False:
self.mon.err(self,"Version of medialist different to Pi Presents")
self.end('error',"Version of medialist different to Pi Presents")
#get controls for this show if top level
controlsmanager=ControlsManager()
if self.top==True:
self.controls_list=controlsmanager.default_controls()
# and merge in controls from profile
self.controls_list=controlsmanager.merge_show_controls(self.controls_list,self.show_params['controls'])
#set up the time of day triggers for the show
if self.show_params['trigger']in('time','time-quiet'):
error_text=self.tod.add_times(self.show_params['trigger-input'],id(self),self.tod_start_callback,self.show_params['trigger'])
if error_text<>'':
self.mon.err(self,error_text)
self.end('error',error_text)
if self.show_params['trigger-end']=='time':
# print self.show_params['trigger-end-time']
error_text=self.tod.add_times(self.show_params['trigger-end-time'],id(self),self.tod_end_callback,'n/a')
if error_text<>'':
self.mon.err(self,error_text)
self.end('error',error_text)
if self.show_params['trigger-end']=='duration':
error_text=self.calculate_duration(self.show_params['trigger-end-time'])
if error_text<>'':
self.mon.err(self,error_text)
self.end('error',error_text)
self.state='closed'
self.egg_timer=None
self.wait_for_trigger()
示例5: play
def play(self,end_callback,ready_callback=None, top=False,command='nil'):
""" displays the mediashow
end_callback - function to be called when the menu exits
ready_callback - callback when menu is ready to display (not used)
top is True when the show is top level (run from [start])
"""
#instantiate the arguments
self._end_callback=end_callback
self._ready_callback=ready_callback
self.top=top
self.command=command
self.mon.log(self,"Starting show: " + self.show['show-ref'])
# check data files are available.
self.media_file = self.pp_profile + "/" + self.show['medialist']
if not os.path.exists(self.media_file):
self.mon.err(self,"Medialist file not found: "+ self.media_file)
self._end('error',"Medialist file not found")
#create a medialist for the mediashow and read it.
self.medialist=MediaList()
if self.medialist.open_list(self.media_file,self.showlist.sissue())==False:
self.mon.err(self,"Version of medialist different to Pi Presents")
self._end('error',"Version of medialist different to Pi Presents")
self._wait_for_trigger()
示例6: play
def play(self,show_id,end_callback,ready_callback,top=False,command='nil'):
""" starts the hyperlink show at start-track
end_callback - function to be called when the show exits
ready_callback - callback when event-show is ready to display its forst track (not used?)
top is True when the show is top level (run from [start] or from show control)
command is not used
"""
#instantiate arguments
self.show_id=show_id
self.end_callback=end_callback
self.ready_callback=ready_callback
self.top=top
self.command=command
# check data files are available.
self.medialist_file = self.pp_profile + "/" + self.show_params['medialist']
if not os.path.exists(self.medialist_file):
self.mon.err(self,"Medialist file not found: "+ self.medialist_file)
self.end('error',"Medialist file not found")
#create a medialist object for the hyperlinkshow and read the file into it.
self.medialist=MediaList()
if self.medialist.open_list(self.medialist_file,self.showlist.sissue()) == False:
self.mon.err(self,"Version of medialist different to Pi Presents")
self.end('error',"Version of medialist different to Pi Presents")
#get controls for this show if top level
controlsmanager=ControlsManager()
if self.top==True:
self.controls_list=controlsmanager.default_controls()
# and merge in controls from profile
self.controls_list=controlsmanager.merge_show_controls(self.controls_list,self.show_params['controls'])
# read show links and 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']
# state variables and signals
self.end_hyperlinkshow_signal= False
self.egg_timer=None
self.next_track_signal=False
self.next_track_ref=''
self.current_track_ref=''
self.current_track_type=''
# ready callback for show
if self.ready_callback<>None:
self.ready_callback()
self.canvas.delete('pp-content')
self.canvas.config(bg='black')
self.do_first_track()
示例7: play
def play(self, show_id, end_callback, ready_callback=None, top=False, command="nil"):
""" displays the mediashow
end_callback - function to be called when the menu exits
ready_callback - callback when menu is ready to display (not used)
top is True when the show is top level (run from [start])
"""
# instantiate the arguments
self.show_id = show_id
self._end_callback = end_callback
self._ready_callback = ready_callback
self.top = top
self.command = command
self.mon.log(self, "Starting show: Id= " + str(self.show_id) + " " + self.show_params["show-ref"])
# check data files are available.
self.media_file = self.pp_profile + "/" + self.show_params["medialist"]
if not os.path.exists(self.media_file):
self.mon.err(self, "Medialist file not found: " + self.media_file)
self._end("error", "Medialist file not found")
# create a medialist for the mediashow and read it.
self.medialist = MediaList()
if self.medialist.open_list(self.media_file, self.showlist.sissue()) == False:
self.mon.err(self, "Version of medialist different to Pi Presents")
self._end("error", "Version of medialist different to Pi Presents")
# set up the time of day triggers for the show
if self.show_params["trigger"] in ("time", "time-quiet"):
error_text = self.tod.add_times(
self.show_params["trigger-input"], id(self), self.tod_start_callback, self.show_params["trigger"]
)
if error_text <> "":
self.mon.err(self, error_text)
self._end("error", error_text)
if self.show_params["trigger-end"] == "time":
# print self.show_params['trigger-end-time']
error_text = self.tod.add_times(
self.show_params["trigger-end-time"], id(self), self.tod_end_callback, "n/a"
)
if error_text <> "":
self.mon.err(self, error_text)
self._end("error", error_text)
if self.show_params["trigger-end"] == "duration":
error_text = self.calculate_duration(self.show_params["trigger-end-time"])
if error_text <> "":
self.mon.err(self, error_text)
self._end("error", error_text)
self._state = "closed"
self.egg_timer = None
self._wait_for_trigger()
示例8: select_medialist
def select_medialist(self,event):
"""
user clicks on a medialst in a profile so try and select it.
"""
# needs forgiving int for possible tkinter upgrade
if len(self.medialists)>0:
self.current_medialists_index=int(event.widget.curselection()[0])
self.current_medialist=MediaList()
if not self.current_medialist.open_list(self.pp_profile_dir+ os.sep + self.medialists[self.current_medialists_index],self.current_showlist.sissue()):
self.mon.err(self,"medialist is a different version to showlist: "+ self.medialists[self.current_medialists_index])
self.app_exit()
self.refresh_tracks_display()
self.refresh_medialists_display()
示例9: play
def play(self,show_id,end_callback,ready_callback,top=False,command='nil'):
""" displays the menu
end_callback - function to be called when the menu exits
ready_callback - callback when menu is ready to display (not used)
top is True when the show is top level (run from [start])
"""
#instantiate arguments
self.show_id=show_id
self.end_callback=end_callback
self.ready_callback=ready_callback
self.top=top
self.command=command
# check data files are available.
self.menu_file = self.pp_profile + "/" + self.show_params['medialist']
if not os.path.exists(self.menu_file):
self.mon.err(self,"Medialist file not found: "+ self.menu_file)
self.end('error',"Medialist file not found")
#create a medialist for the menu and read it.
self.medialist=MediaList()
if self.medialist.open_list(self.menu_file,self.showlist.sissue()) == False:
self.mon.err(self,"Version of medialist different to Pi Presents")
self.end('error',"Version of medialist different to Pi Presents")
#get control bindings for this show if top level
controlsmanager=ControlsManager()
if self.top==True:
self.controls_list=controlsmanager.default_controls()
# and merge in controls from profile
self.controls_list=controlsmanager.merge_show_controls(self.controls_list,self.show_params['controls'])
if self.show_params['has-background']=="yes":
background_index=self.medialist.index_of_track ('pp-menu-background')
if background_index>=0:
self.menu_img_file = self.complete_path(self.medialist.track(background_index)['location'])
if not os.path.exists(self.menu_img_file):
self.mon.err(self,"Menu background file not found: "+ self.menu_img_file)
self.end('error',"Menu background file not found")
else:
self.mon.err(self,"Menu background not found in medialist")
self.end('error',"Menu background not found")
self.end_menushow_signal= False
if self.ready_callback<>None:
self.ready_callback()
self.menu_timeout_value=int(self.show_params['timeout'])*1000
self.do_menu()
示例10: medialist_selected
def medialist_selected(self,key):
"""
user clicks on a medialst in a profile so try and select it.
"""
# print 'selected',type(self.medialists_display.get_key()),self.medialists_display.get_key()
if len(self.medialists)>0:
self.current_medialists_index=self.medialists_display.get_key()
self.current_medialist=MediaList('ordered')
if not self.current_medialist.open_list(self.pp_profile_dir+ os.sep + self.medialists[self.current_medialists_index],self.current_showlist.sissue()):
OKDialog(self,"medialist is a different version to showlist: "+ self.medialists[self.current_medialists_index]).show(self)
#self.app_exit()
return
self.refresh_tracks_display()
self.refresh_medialists_display()
示例11: play
def play(self,end_callback,ready_callback=None, top=False,command='nil'):
""" displays the liveshow
end_callback - function to be called when the liveshow exits
ready_callback - callback when liveshow is ready to display
top is True when the show is top level (i.e. run from start show)
"""
#instantiate the arguments
self._end_callback=end_callback
self._ready_callback=ready_callback
self.top=top
self.mon.log(self,"Starting show: " + self.show['show-ref'])
# check data files are available.
self.media_file = self.pp_profile + os.sep + self.show['medialist']
if not os.path.exists(self.media_file):
self.mon.err(self,"Medialist file not found: "+ self.media_file)
self._stop("Medialist file not found")
self.options=command_options()
self._pp_live_dir1 = self.pp_home + os.sep + 'pp_live_tracks'
if not os.path.exists(self._pp_live_dir1):
os.mkdir(self._pp_live_dir1)
self._pp_live_dir2=''
if self.options['liveshow'] <>"":
self._pp_live_dir2 = self.options['liveshow']
if not os.path.exists(self._pp_live_dir2):
self.mon.err(self,"live tracks directory not found " + self._pp_live_dir2)
self._end('error',"live tracks directory not found")
#create a medialist for the liveshow and read it.
# it should be empty of anonymous tracks but read it to check its version.
self.medialist=MediaList()
if self.medialist.open_list(self.media_file,self.showlist.sissue())==False:
self.mon.err(self,"Version of medialist different to Pi Presents")
self._end('error',"Version of medialist different to Pi Presents")
if self.ready_callback<>None:
self.ready_callback()
self._play_first_track()
示例12: play
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()
示例13: HyperlinkShow
#.........这里部分代码省略.........
command_callback)
# instatiatate the screen driver - used only to access enable and hide click areas
self.sr=ScreenDriver()
# create a path stack and control path debugging
if self.show_params['debug-path']=='yes':
self.debug=True
else:
self.debug=False
self.path = PathManager()
self.allowed_links=('return','home','call','null','exit','goto','play','jump','repeat','pause','no-command','stop','pause-on','pause-off','mute','unmute','go')
# init variables
self.track_timeout_timer=None
self.show_timeout_timer=None
self.next_track_signal=False
self.next_track_ref=''
self.current_track_ref=''
self.current_track_type=''
self.req_next=''
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()
示例14: __init__
class MediaShow:
# *******************
# External interface
# ********************
def __init__(self, show_params, canvas, showlist, pp_home, pp_profile):
""" canvas - the canvas that the menu is to be written on
show - the dictionary fo the show to be played
pp_home - Pi presents data_home directory
pp_profile - Pi presents profile directory
"""
self.mon = Monitor()
self.mon.on()
# instantiate arguments
self.show_params = show_params
self.showlist = showlist
self.canvas = canvas
self.pp_home = pp_home
self.pp_profile = pp_profile
# open resources
self.rr = ResourceReader()
# Init variables
self.player = None
self.shower = None
self._poll_for_interval_timer = None
self._poll_for_continue_timer = None
self._waiting_for_interval = False
self._interval_timer = None
self.duration_timer = None
self.error = False
self._interval_timer_signal = False
self._end_trigger_signal = False
self._end_mediashow_signal = False
self._next_track_signal = False
self._previous_track_signal = False
self._play_child_signal = False
self._req_next = "nil"
# create and instance of TimeOfDay scheduler so we can add events
self.tod = TimeOfDay()
self._state = "closed"
def play(self, show_id, end_callback, ready_callback=None, top=False, command="nil"):
""" displays the mediashow
end_callback - function to be called when the menu exits
ready_callback - callback when menu is ready to display (not used)
top is True when the show is top level (run from [start])
"""
# instantiate the arguments
self.show_id = show_id
self._end_callback = end_callback
self._ready_callback = ready_callback
self.top = top
self.command = command
self.mon.log(self, "Starting show: Id= " + str(self.show_id) + " " + self.show_params["show-ref"])
# check data files are available.
self.media_file = self.pp_profile + "/" + self.show_params["medialist"]
if not os.path.exists(self.media_file):
self.mon.err(self, "Medialist file not found: " + self.media_file)
self._end("error", "Medialist file not found")
# create a medialist for the mediashow and read it.
self.medialist = MediaList()
if self.medialist.open_list(self.media_file, self.showlist.sissue()) == False:
self.mon.err(self, "Version of medialist different to Pi Presents")
self._end("error", "Version of medialist different to Pi Presents")
# set up the time of day triggers for the show
if self.show_params["trigger"] in ("time", "time-quiet"):
error_text = self.tod.add_times(
self.show_params["trigger-input"], id(self), self.tod_start_callback, self.show_params["trigger"]
)
if error_text <> "":
self.mon.err(self, error_text)
self._end("error", error_text)
if self.show_params["trigger-end"] == "time":
# print self.show_params['trigger-end-time']
error_text = self.tod.add_times(
self.show_params["trigger-end-time"], id(self), self.tod_end_callback, "n/a"
)
if error_text <> "":
self.mon.err(self, error_text)
self._end("error", error_text)
if self.show_params["trigger-end"] == "duration":
error_text = self.calculate_duration(self.show_params["trigger-end-time"])
if error_text <> "":
self.mon.err(self, error_text)
self._end("error", error_text)
#.........这里部分代码省略.........
示例15: __init__
class PPEditor:
# ***************************************
# INIT
# ***************************************
def __init__(self):
self.editor_issue="1.2"
# get command options
self.command_options=ed_options()
# get directory holding the code
self.pp_dir=sys.path[0]
if not os.path.exists(self.pp_dir+os.sep+"pp_editor.py"):
tkMessageBox.showwarning("Pi Presents","Bad Application Directory")
exit()
#Initialise logging
Monitor.log_path=self.pp_dir
self.mon=Monitor()
self.mon.on()
if self.command_options['debug'] == True:
Monitor.global_enable=True
else:
Monitor.global_enable=False
self.mon.log (self, "Pi Presents Editor is starting")
self.mon.log (self," OS and separator " + os.name +' ' + os.sep)
self.mon.log(self,"sys.path[0] - location of code: code "+sys.path[0])
# set up the gui
#root is the Tkinter root widget
self.root = tk.Tk()
self.root.title("Editor for Pi Presents")
# self.root.configure(background='grey')
self.root.resizable(False,False)
#define response to main window closing
self.root.protocol ("WM_DELETE_WINDOW", self.app_exit)
# bind some display fields
self.filename = tk.StringVar()
self.display_selected_track_title = tk.StringVar()
self.display_show = tk.StringVar()
# define menu
menubar = Menu(self.root)
profilemenu = Menu(menubar, tearoff=0, bg="grey", fg="black")
profilemenu.add_command(label='Open', command = self.open_existing_profile)
profilemenu.add_command(label='Validate', command = self.validate_profile)
menubar.add_cascade(label='Profile', menu = profilemenu)
ptypemenu = Menu(profilemenu, tearoff=0, bg="grey", fg="black")
ptypemenu.add_command(label='Exhibit', command = self.new_exhibit_profile)
ptypemenu.add_command(label='Media Show', command = self.new_mediashow_profile)
ptypemenu.add_command(label='Menu', command = self.new_menu_profile)
ptypemenu.add_command(label='Presentation', command = self.new_presentation_profile)
ptypemenu.add_command(label='Interactive', command = self.new_interactive_profile)
ptypemenu.add_command(label='Live Show', command = self.new_liveshow_profile)
ptypemenu.add_command(label='RadioButton Show', command = self.new_radiobuttonshow_profile)
ptypemenu.add_command(label='Hyperlink Show', command = self.new_hyperlinkshow_profile)
ptypemenu.add_command(label='Blank', command = self.new_blank_profile)
profilemenu.add_cascade(label='New from Template', menu = ptypemenu)
showmenu = Menu(menubar, tearoff=0, bg="grey", fg="black")
showmenu.add_command(label='Delete', command = self.remove_show)
showmenu.add_command(label='Edit', command = self.m_edit_show)
showmenu.add_command(label='Copy To', command = self.copy_show)
menubar.add_cascade(label='Show', menu = showmenu)
stypemenu = Menu(showmenu, tearoff=0, bg="grey", fg="black")
stypemenu.add_command(label='Menu', command = self.add_menu)
stypemenu.add_command(label='MediaShow', command = self.add_mediashow)
stypemenu.add_command(label='LiveShow', command = self.add_liveshow)
stypemenu.add_command(label='HyperlinkShow', command = self.add_hyperlinkshow)
stypemenu.add_command(label='RadioButtonShow', command = self.add_radiobuttonshow)
showmenu.add_cascade(label='Add', menu = stypemenu)
medialistmenu = Menu(menubar, tearoff=0, bg="grey", fg="black")
menubar.add_cascade(label='MediaList', menu = medialistmenu)
medialistmenu.add_command(label='Add', command = self.add_medialist)
medialistmenu.add_command(label='Delete', command = self.remove_medialist)
trackmenu = Menu(menubar, tearoff=0, bg="grey", fg="black")
trackmenu.add_command(label='Delete', command = self.remove_track)
trackmenu.add_command(label='Edit', command = self.m_edit_track)
#.........这里部分代码省略.........