def mock_source_select(): from resources.lib.gui.windows.source_select import SourceSelect sources = [mock_source for i in range(10)] window = SourceSelect( *SkinManager().confirm_skin_path("source_select.xml"), item_information=_mock_information, sources=sources) window.doModal() del window
def source_select(uncached_sources, source_list, item_information): selection = None try: if len(source_list) == 0 and len(uncached_sources) == 0: return None from resources.lib.gui.windows.source_select import SourceSelect selection = None try: window = SourceSelect( *SkinManager().confirm_skin_path("source_select.xml"), item_information=item_information, sources=source_list, uncached=uncached_sources) selection = window.doModal() finally: del window if selection is None: g.notification(g.ADDON_NAME, g.get_language_string(30032), time=5000) raise Exception if not selection: g.cancel_playback() finally: return selection
def sourceSelect(uncached_sources, source_list, info): try: if len(source_list) == 0: return None from resources.lib.gui.windows.source_select import SourceSelect window = SourceSelect('source_select.xml', tools.addonDir, actionArgs=info, sources=source_list) selection = window.doModal() del window except: import traceback traceback.print_exc() return None return selection
def sourceSelect(uncached_sources, source_list, info): try: if len(source_list) == 0: return None from resources.lib.gui.windows.source_select import SourceSelect window = SourceSelect( *SkinManager().confirm_skin_path('source_select.xml'), actionArgs=info, sources=source_list) selection = window.doModal() del window except: import traceback traceback.print_exc() return None return selection