def __init__(self, module_name): if not module_name: message = 'Error: a module name is required' raise Exception(message) elif '.' in module_name: message = 'Error: module name cannot contain . character' raise Exception(message) self.module_name = module_name self.img_search = cum_image('cum-search.png') self.img_cat = cum_image('cum-cat.png') self.img_next = cum_image('cum-next.png')
def INDEX(): url_dispatcher.add_dir('[COLOR white]{}[/COLOR]'.format( utils.i18n('sites')), '', 'site_list', basics.cum_image('cum-sites.png'), '', list_avail=False) url_dispatcher.add_dir('[COLOR white]{}[/COLOR]'.format( utils.i18n('fav_videos')), '', 'favorites.List', basics.cum_image('cum-fav.png'), '', list_avail=False) download_path = addon.getSetting('download_path') if download_path != '' and xbmcvfs.exists(download_path): url_dispatcher.add_dir('[COLOR white]{}[/COLOR]'.format( utils.i18n('dnld_folder')), download_path, 'OpenDownloadFolder', basics.cum_image('cum-downloads.png'), '', list_avail=False) url_dispatcher.add_dir('[COLOR white]{}[/COLOR]'.format( utils.i18n('custom_list')), '', 'favorites.create_custom_list', Folder=False, list_avail=False) for rowid, name in favorites.get_custom_lists(): url_dispatcher.add_dir(name, str(rowid), 'favorites.load_custom_list', list_avail=False, custom_list=True) favorites.load_custom_list('main') url_dispatcher.add_dir('[COLOR white]{}[/COLOR]'.format( utils.i18n('clear_cache')), '', 'utils.clear_cache', basics.cuminationicon, '', Folder=False, list_avail=False) utils.eod(basics.addon_handle, False)
def alphabeticalSearch(url, channel, keyword=None): if keyword: searchDir(url, channel, page=None, alphabet=keyword) else: key_list = keys() for c, count in sorted(key_list.items()): name = '[COLOR deeppink]{}[/COLOR] [COLOR lightpink]({})[/COLOR]'.format(c, count) addDir(name, url, "utils.alphabeticalSearch", cum_image('cum-search.png'), '', channel, keyword=c) eod()
def __init__(self, name, title, url, image=None, about=None, webcam=False): self.default_mode = '' self.name = name self.title = title + '[COLOR lime] - webcams[/COLOR]' if webcam else title self.url = url self.image = basics.cum_image(image) if image else '' self.about = about self.webcam = webcam self.custom = False self.add_to_instances()
def alphabeticalSearch(url, channel, keyword=None): if keyword: searchDir(url, channel, page=None, alphabet=keyword) else: for c in string.ascii_uppercase: name = '[COLOR deeppink]' + c + '[/COLOR]' addDir(name, url, "utils.alphabeticalSearch", cum_image('cum-search.png'), '', channel, keyword=c) eod()
def image(self): self.load_stored_data_if_needed() return basics.cum_image(self.db_image, True) if self.db_image else None