def create(heading, message): ''' A stub implementation for the xbmcgui DialogProgressBG class create() method ''' heading = kodi_to_ansi(heading) message = kodi_to_ansi(message) print( '\033[37;44;1mPROGRESS:\033[35;49;1m [%s] \033[37;1m%s\033[39;0m' % (heading, message))
def textviewer(heading, text=None, usemono=None): ''' A stub implementation for the xbmcgui Dialog class textviewer() method ''' heading = kodi_to_ansi(heading) text = kodi_to_ansi(text) print( '\033[37;44;1mTEXTVIEWER:\033[35;49;1m [%s]\n\033[37;1m%s\033[39;0m' % (heading, text))
def test_livetv_description(self): description = self._tvguide.live_description('een') print(kodi_to_ansi(description)) description = self._tvguide.live_description('canvas') print(kodi_to_ansi(description)) description = self._tvguide.live_description('ketnet') print(kodi_to_ansi(description))
def create(heading, line1, line2=None, line3=None): ''' A stub implementation for the xbmcgui DialogProgress class create() method ''' heading = kodi_to_ansi(heading) line1 = kodi_to_ansi(line1) print( '\033[37;44;1mPROGRESS:\033[35;49;1m [%s] \033[37;1m%s\033[39;0m' % (heading, line1))
def notification(heading, message, icon=None, time=None, sound=None): ''' A working implementation for the xbmcgui Dialog class notification() method ''' heading = kodi_to_ansi(heading) message = kodi_to_ansi(message) print( '\033[37;44;1mNOTIFICATION:\033[35;49;1m [%s] \033[37;1m%s\033[39;0m' % (heading, message))
def create(heading, line1=None, line2=None, line3=None): """A stub implementation for the xbmcgui DialogProgress class create() method""" heading = kodi_to_ansi(heading) if line1: line1 = kodi_to_ansi(line1) print('\033[37;100mPROGRESS:\033[35;0m [%s] \033[35;0m%s\033[39;0m' % (heading, line1)) else: print('\033[37;100mPROGRESS:\033[39;0m [%s]' % heading)
def create(self, heading, line1, line2=None, line3=None): """A stub implementation for the xbmcgui DialogProgress class create() method""" self.percentage = 0 heading = kodi_to_ansi(heading) line1 = kodi_to_ansi(line1) print( '\033[37;44;1mPROGRESS:\033[35;49;1m [%s] \033[37;1m%s\033[39;0m' % (heading, line1)) sys.stdout.flush()
def __init__(self, label='', label2='', iconImage='', thumbnailImage='', path='', offscreen=False): ''' A stub constructor for the xbmcgui ListItem class ''' self.label = kodi_to_ansi(label) self.label2 = kodi_to_ansi(label2) self.path = path
def test_tvguide_date_menu(self): ''' Test TV guide main menu ''' date_items = self._tvguide.get_date_items() self.assertEqual(len(date_items), 37) date_item = random.choice(date_items) print('- %s%s' % (kodi_to_ansi(date_item.title), uri_to_path(date_item.path))) date_items = self._tvguide.get_date_items('today') self.assertEqual(len(date_items), 37) date_item = random.choice(date_items) print('- %s%s' % (kodi_to_ansi(date_item.title), uri_to_path(date_item.path)))
def update(self, percentage, line1=None, line2=None, line3=None): ''' A stub implementation for the xbmcgui DialogProgress class update() method ''' if (percentage - 5) < self.percentage: return self.percentage = percentage line1 = kodi_to_ansi(line1) line2 = kodi_to_ansi(line2) line3 = kodi_to_ansi(line3) if line1 or line2 or line3: print('[37;100mPROGRESS:[35;0m [%d%%] [35;0m%s[0m' % (percentage, line1 or line2 or line3)) else: print('[1G[37;100mPROGRESS:[35;0m [%d%%]' % (percentage), end='')
def update(self, percent, line1=None, line2=None, line3=None): """A stub implementation for the xbmcgui DialogProgress class update() method""" if (percent - 5) < self.percent: return self.percent = percent line1 = kodi_to_ansi(line1) line2 = kodi_to_ansi(line2) line3 = kodi_to_ansi(line3) if line1 or line2 or line3: print('\033[37;100mPROGRESS:\033[35;0m [%d%%] \033[35;0m%s\033[39;0m' % (percent, line1 or line2 or line3)) else: print('\033[1G\033[37;100mPROGRESS:\033[35;0m [%d%%]\033[39;0m' % (percent), end='')
def yesno(heading, line1, line2=None, line3=None, nolabel=None, yeslabel=None, autoclose=0): ''' A stub implementation for the xbmcgui Dialog class yesno() method ''' heading = kodi_to_ansi(heading) line1 = kodi_to_ansi(line1) print('\033[37;44;1mYESNO:\033[35;49;1m [%s] \033[37;1m%s\033[39;0m' % (heading, line1)) return True
def multiselect(heading, options, autoclose=0, preselect=None, useDetails=False): # pylint: disable=useless-return ''' A stub implementation for the xbmcgui Dialog class multiselect() method ''' if preselect is None: preselect = [] heading = kodi_to_ansi(heading) print('\033[37;44;1mMULTISELECT:\033[35;49;1m [%s] \033[37;1m%s\033[39;0m' % (heading, ', '.join(options))) return None
def addDirectoryItem(handle, path, listitem, isFolder=False): ''' A reimplementation of the xbmcplugin addDirectoryItems() function ''' label = kodi_to_ansi(listitem.label) path = uri_to_path(path) if path else '' bullet = '»' if isFolder else '·' print('{bullet} {label}{path}'.format(bullet=bullet, label=label, path=path)) return True
def test_tvguide_channel_menu(self): ''' Test channel menu ''' channel_items = self._tvguide.get_channel_items(channel='een') self.assertTrue(channel_items) channel_item = random.choice(channel_items) print( '- %s%s' % (kodi_to_ansi(channel_item.title), uri_to_path(channel_item.path))) date = (datetime.now(dateutil.tz.tzlocal()) + timedelta(days=-10)).strftime('%Y-%m-%d') channel_items = self._tvguide.get_channel_items(date=date) self.assertTrue(channel_items) channel_item = random.choice(channel_items) print( '- %s%s' % (kodi_to_ansi(channel_item.title), uri_to_path(channel_item.path)))
def test_episode_plot(self): title_items, sort, ascending, content = self._apihelper.list_episodes( program='thuis', season='allseasons') self.assertEqual(sort, 'dateadded') self.assertFalse(ascending) self.assertEqual(content, 'episodes') plot = title_items[0].info_dict['plot'] print(kodi_to_ansi(plot))
def update(self, percentage, heading=None, message=None): ''' A stub implementation for the xbmcgui DialogProgressBG class update() method ''' if (percentage - 5) < self.percentage: return self.percentage = percentage message = kodi_to_ansi(message) if message: print('\033[37;44;1mPROGRESS:\033[35;49;1m [%d%%] \033[37;1m%s\033[39;0m' % (percentage, message)) else: print('\033[1G\033[37;44;1mPROGRESS:\033[35;49;1m [%d%%]\033[39;0m' % (percentage), end='')
def update(self, percentage, line1=None, line2=None, line3=None): ''' A stub implementation for the xbmcgui DialogProgress class update() method ''' if (percentage - 5) < self.percentage: return self.percentage = percentage line1 = kodi_to_ansi(line1) line2 = kodi_to_ansi(line2) line3 = kodi_to_ansi(line3) if line1 or line2 or line3: print( '\033[1G\033[37;44;1mPROGRESS:\033[35;49;1m [%d%%] \033[37;1m%s\033[39;0m' % (percentage, line1 or line2 or line3), end='') else: print( '\033[1G\033[37;44;1mPROGRESS:\033[35;49;1m [%d%%]\033[39;0m' % (percentage), end='') sys.stdout.flush()
def addDirectoryItems(handle, listing, length=None): ''' A reimplementation of the xbmcplugin addDirectoryItems() function ''' for item in listing: label = kodi_to_ansi(item[1].label) path = uri_to_path(item[0]) if item[0] else '' # perma = kodi_to_ansi(item[1].label) # FIXME: Add permalink bullet = '»' if item[2] else '·' print('{bullet} {label}{path}'.format(bullet=bullet, label=label, path=path)) return True
def select(heading, opt_list, autoclose=0, preselect=None, useDetails=False): ''' A stub implementation for the xbmcgui Dialog class select() method ''' if preselect is None: preselect = [] heading = kodi_to_ansi(heading) print('\033[37;44;1mSELECT:\033[35;49;1m [%s] \033[37;1m%s\033[39;0m' % (heading, ', '.join(opt_list))) return -1
def ok(heading, line1, line2=None, line3=None): """A stub implementation for the xbmcgui Dialog class ok() method""" heading = kodi_to_ansi(heading) line1 = kodi_to_ansi(line1) print('\033[37;100mOK:\033[35;0m [%s] \033[35;0m%s\033[39;0m' % (heading, line1))
def endOfDirectory(handle, succeeded=True, updateListing=True, cacheToDisc=True): ''' A stub implementation of the xbmcplugin endOfDirectory() function ''' print(kodi_to_ansi('[B]-=( [COLOR cyan]--------[/COLOR] )=-[/B]'))
def create(heading, line1, line2=None, line3=None): ''' A stub implementation for the xbmcgui DialogProgress class create() method ''' heading = kodi_to_ansi(heading) line1 = kodi_to_ansi(line1) print('[37;100mPROGRESS:[35;0m [%s] [35;0m%s[0m' % (heading, line1))
def yesno(heading, line1, line2=None, line3=None, nolabel=None, yeslabel=None, autoclose=0): ''' A stub implementation for the xbmcgui Dialog class yesno() method ''' heading = kodi_to_ansi(heading) line1 = kodi_to_ansi(line1) print('[37;100mYESNO:[35;0m [%s] [35;0m%s[0m' % (heading, line1)) return True
def ok(heading, line1, line2=None, line3=None): ''' A stub implementation for the xbmcgui Dialog class ok() method ''' heading = kodi_to_ansi(heading) line1 = kodi_to_ansi(line1) print('[37;100mOK:[35;0m [%s] [35;0m%s[0m' % (heading, line1))
def notification(heading, message, icon=None, time=None, sound=None): ''' A working implementation for the xbmcgui Dialog class notification() method ''' heading = kodi_to_ansi(heading) message = kodi_to_ansi(message) print('[37;100mNOTIFICATION:[35;0m [%s] [35;0m%s[0m' % (heading, message))
def setPluginCategory(handle, category): """A reimplementation of the xbmcplugin setPluginCategory() function""" print(kodi_to_ansi('[B]-=( [COLOR cyan]%s[/COLOR] )=-[/B]' % category))
def ok(heading, line1, line2=None, line3=None): ''' A stub implementation for the xbmcgui Dialog class ok() method ''' heading = kodi_to_ansi(heading) line1 = kodi_to_ansi(line1) print('\033[37;44;1mOK:\033[35;49;1m [%s] \033[37;1m%s\033[39;0m' % (heading, line1))