예제 #1
0
 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))
예제 #2
0
 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))
예제 #3
0
 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))
예제 #4
0
 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))
예제 #5
0
 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))
예제 #6
0
 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)
예제 #7
0
 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()
예제 #8
0
 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
예제 #9
0
 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)))
예제 #10
0
 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('PROGRESS: [%d%%] %s' % (percentage, line1 or line2 or line3))
     else:
         print('PROGRESS: [%d%%]' % (percentage), end='')
예제 #11
0
 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='')
예제 #12
0
 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
예제 #13
0
 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
예제 #14
0
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
예제 #15
0
    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))
예제 #17
0
 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='')
예제 #18
0
 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
예제 #20
0
 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
예제 #21
0
 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))
예제 #22
0
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]'))
예제 #23
0
 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('PROGRESS: [%s] %s' % (heading, line1))
예제 #24
0
 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('YESNO: [%s] %s' % (heading, line1))
     return True
예제 #25
0
 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('OK: [%s] %s' % (heading, line1))
예제 #26
0
 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('NOTIFICATION: [%s] %s' % (heading, message))
def setPluginCategory(handle, category):
    """A reimplementation of the xbmcplugin setPluginCategory() function"""
    print(kodi_to_ansi('[B]-=( [COLOR cyan]%s[/COLOR] )=-[/B]' % category))
예제 #28
0
 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))