Beispiel #1
0
 def setUp(self):
     self.dialog = Xbmcgui.Dialog()
     self.dialog.select = MagicMock(name='select')
     xbmcgui = Xbmcgui()
     xbmcgui.Dialog = MagicMock(name='Dialog')
     xbmcgui.Dialog.return_value = self.dialog
     self.navigation = Navigation(None, None, xbmcgui, [None, 1])
Beispiel #2
0
 def setUp(self):
     self.dialog = Xbmcgui.Dialog()
     self.dialog.select = MagicMock(name='select')
     xbmcgui = Xbmcgui()
     xbmcgui.Dialog = MagicMock(name='Dialog')
     xbmcgui.Dialog.return_value = self.dialog
     self.navigation = Navigation(None, None, xbmcgui, [None, 1])
Beispiel #3
0
 def setUp(self):
     self.xbmc = Xbmc(Xbmc.LOGERROR)
     self.xbmcplugin = Xbmcplugin(self.xbmc)
     self.xbmcgui = Xbmcgui()
     self.xbmcaddon = Xbmcaddon()
Beispiel #4
0
                ret = self.new_menu()
            elif action == ACTION_TOP:
                ret = self.top_menu()
            elif action == ACTION_FAVORITES:
                ret = self.favorites_menu()
            elif action == ACTION_CATEGORIES:
                ret = self.categories_menu()
            elif action == ACTION_CATEGORY:
                ret = self.category_menu()
            elif action == ACTION_SEARCH:
                ret = self.search_menu()
            elif action == ACTION_VIDEO:
                ret = self.video()
            elif action == ACTION_NEXT_PAGE:
                ret = self.next_page()
        return self.xbmcplugin.endOfDirectory(self.handle, succeeded=ret,
                                              cacheToDisc=True)

# Use of standalone Navigation for testing:
# python navigation.py <params>
if __name__ == '__main__':
    from mocks import Xbmc, Xbmcplugin, Xbmcgui, Xbmcaddon
    xbmc = Xbmc(level=xbmc.LOGNOTICE)
    xbmcplugin = Xbmcplugin(xbmc)
    xbmcgui = Xbmcgui()
    xbmcaddon = Xbmcaddon()
    swe = swefilmer.Swefilmer(xbmc, xbmcplugin, xbmcgui, xbmcaddon)
    navigation = Navigation(xbmc, xbmcplugin, xbmcgui, xbmcaddon, swe,
                            'plugin', '10', '?' + sys.argv[1])
    navigation.dispatch()
Beispiel #5
0
 def setUp(self):
     self.xbmc = Xbmc(Xbmc.LOGDEBUG)
     self.xbmcplugin = Xbmcplugin(self.xbmc)
     self.xbmcgui = Xbmcgui()
     self.addon = Xbmcaddon.Addon(id='plugin.video.swefilmer')