当前位置: 首页>>代码示例>>Python>>正文


Python XBMCInterfaceUtils.executePlugin方法代码示例

本文整理汇总了Python中common.XBMCInterfaceUtils.executePlugin方法的典型用法代码示例。如果您正苦于以下问题:Python XBMCInterfaceUtils.executePlugin方法的具体用法?Python XBMCInterfaceUtils.executePlugin怎么用?Python XBMCInterfaceUtils.executePlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common.XBMCInterfaceUtils的用法示例。


在下文中一共展示了XBMCInterfaceUtils.executePlugin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: judgeTurtleNextAction

# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import executePlugin [as 别名]
 def judgeTurtleNextAction(self, actionObj):
     ProgressDisplayer().displayMessage(80, line1='Preparing items for display or play', line2='Total items: ' + str(len(self.response_obj.get_item_list())))
     if self.response_obj.get_redirect_action_name() is None:
         isAnyPlayableItem = False
         isItemsList = False
         playlist_type = None
         for item in self.response_obj.get_item_list():
             nextActionId = actionObj.get_next_action_map()[item.get_next_action_name()]
             if nextActionId == '__play__':
                 if item.get_moving_data().has_key('pluginUrl'):
                     XBMCInterfaceUtils.executePlugin(item.get_moving_data()['pluginUrl'])
                 else:
                     if not isAnyPlayableItem and not XBMCInterfaceUtils.isPlaying():
                         XBMCInterfaceUtils.clearPlayList()  # Clear playlist item only when at least one video item is found.
                     playlist_type = XBMCInterfaceUtils.addPlayListItem(item)
                     isAnyPlayableItem = True
             elif nextActionId == '__service_response__':
                 # Do Nothing , get response object from container for parameters to be returned
                 pass
             elif nextActionId == '__download__':
                 downloadPath = self.addon_context.addon.getSetting('downloadPath')
                 if downloadPath is None or downloadPath == '':
                     XBMCInterfaceUtils.displayDialogMessage("Download path not provided", "Please provide download path in add-on settings.", "The download path should be a local directory.")
                     self.addon_context.addon.openSettings(sys.argv[ 0 ])
                     downloadPath = self.addon_context.addon.getSetting('downloadPath')
                 if downloadPath is not None and downloadPath != '':
                     XBMCInterfaceUtils.downloadVideo(item, downloadPath)
             elif nextActionId == '__resolved__':
                 XBMCInterfaceUtils.setResolvedMediaUrl(item)
             else:
                 isItemsList = True
                 is_Folder = self.addon_context.isNextActionFolder(actionObj.get_action_id(), item.get_next_action_name())
                 downloadAction = self.addon_context.getDownloadActionIfDownloadable(actionObj.get_action_id(), item.get_next_action_name())
                 if(downloadAction is not None):
                     XBMCInterfaceUtils.addContextMenuItem(item, 'Download Video', downloadAction)
                 XBMCInterfaceUtils.addFolderItem(item, nextActionId, is_Folder)
             del item  # deletes item
         if isAnyPlayableItem == True:
             ProgressDisplayer().end()
             try:
                 if playlist_type is not None:
                     XBMCInterfaceUtils.play(list_type=playlist_type)
                 else:
                     XBMCInterfaceUtils.play()
             except Exception, e:
                 Logger.logFatal(e)
         elif isItemsList:
             if self.response_obj.get_xbmc_sort_method() is not None:
                 XBMCInterfaceUtils.sortMethod(self.response_obj.get_xbmc_sort_method())
             if self.response_obj.get_xbmc_content_type() is not None:
                 XBMCInterfaceUtils.setContentType(self.response_obj.get_xbmc_content_type())
             XBMCInterfaceUtils.setSortMethods()
开发者ID:jigarsavla,项目名称:apple-tv2-xbmc,代码行数:54,代码来源:TurtleContainer.py


注:本文中的common.XBMCInterfaceUtils.executePlugin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。