def toolbar_icon_clicked(self, widget, movie):
if not movie or not movie.trailer:
return False
use_shell = True
command = self.get_config_value('command', self.preferences['command']['default'])
if is_windows_system():
use_shell = False # Popen with shell=True doesn't work under windows with spaces in filenames
if not command:
import win32api
log.debug('try ShellExecute with trailer %s' % movie.trailer)
win32api.ShellExecute(0, None, movie.trailer, None, None, 0)
return
if '{1}' in command:
command = command.replace('{1}', movie.trailer)
else:
# make a sequence results in Popen calls list2cmdline
command = [command, movie.trailer]
log.debug(command)
Popen(command, shell=use_shell)
评论列表
文章目录