guis.py 文件源码

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

项目:script.reddit.reader 作者: gedisony 项目源码 文件源码
def process_clicked_item(self, clicked_item):
        if isinstance(clicked_item, xbmcgui.ListItem ):
            di_url=clicked_item.getProperty('onClick_action') #this property is created when assembling the kwargs.get("listing") for this class
            item_type=clicked_item.getProperty('item_type').lower()
        elif isinstance(clicked_item, xbmcgui.ControlButton ):
            #buttons have no setProperty() hiding it in Label2 no good.
            #ast.literal_eval(cxm_string):
            #di_url=clicked_item.getLabel2()
            #log('  button label2='+repr(di_url))
            #item_type=clicked_item.getProperty('item_type').lower()
            pass

        log( "  clicked %s  IsPlayable=%s  url=%s " %( repr(clicked_item),item_type, di_url )   )
        if item_type=='playable':
                #a big thank you to spoyser (http://forum.kodi.tv/member.php?action=profile&uid=103929) for this help
                pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
                pl.clear()
                pl.add(di_url, clicked_item)
                xbmc.Player().play(pl, windowed=False)
        elif item_type=='script':
            #if user clicked on 'next' we close this screen and load the next page.
            if 'mode=listSubReddit' in di_url:
                self.busy_execute_sleep(di_url,500,True )
            else:
                self.busy_execute_sleep(di_url,3000,False )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号