guis.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:script.reddit.reader 作者: gedisony 项目源码 文件源码
def onAction(self, action):
        if action in [ xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK ]:
            self.close()

        try:focused_control=self.getFocusId()
        except:focused_control=0
        #log('focused control='+repr(focused_control)+' action='+repr(action))
        if focused_control==self.main_control_id:  #main_control_id is the listbox

            self.gui_listbox_SelectedPosition  = self.gui_listbox.getSelectedPosition()
            item = self.gui_listbox.getSelectedItem()

            item_type=item.getProperty('item_type').lower()

            if action in [ xbmcgui.ACTION_CONTEXT_MENU ]:
                ACTION_manage_subreddits=item.getProperty('ACTION_manage_subreddits')
                log( "   left pressed  %d IsPlayable=%s  url=%s " %(  self.gui_listbox_SelectedPosition, item_type, ACTION_manage_subreddits )   )
                if ACTION_manage_subreddits:
                    xbmc.executebuiltin( ACTION_manage_subreddits  )
                    self.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号