Esempio n. 1
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)))
Esempio n. 2
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
Esempio n. 3
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 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