Beispiel #1
0
 def _get_intro(self, id, arg=None):
     if True == True:
     
         if   id == REGION: name = NEWS;   img = 'news.png'
         elif id == NEWS:   name = NEWS;   img = 'news.png'
         elif id == SPORT:  name = SPORT;  img = 'sport.png'
         elif id == SUPER:  name = SUPER;  img = 'kids.png'
         elif id == NATURE: name = NATURE; img = 'ntur.png'
         else: 
             name = NEWS; img = 'news.png'
             
         title = '%s %s' % (name, 'hovedvignett')
         img = Plugin.image(img)
         key = Key('new', type=PLAYLIST_VIGNETE)
         istart = MediaObj(title=title, thumbnail=img, key=key)
         istart.isPlayable = True; istart.isFolder = False
         istart.url = Plugin.videopath(name + '_intro_main.avi')
         
         title = '%s %s' % (name, 'vignett')
         key = Key('new', type=PLAYLIST_VIGNETE)
         imid = MediaObj(title=title, thumbnail=img, key=key)
         imid.isPlayable = True; imid.isFolder = False
         imid.url = Plugin.videopath(name + '_intro.avi')
         
         return istart, imid, istart
         
     else:    
         url = uri.playlist(loop=id, type=arg)
         data = self.dman.get_data(url)
         if data:
             tmp_list = extract.playlist(data)
             return tmp_list[0], tmp_list[2], tmp_list[-1]
 def __init__(self):
     Plugin.__init__(self)
     
     if self.state.refresh == True:
         self.state.refresh = False
         key = Key.build_url('program', words=self.state.__dict__)
         xbmc.executebuiltin("ReplaceWindow(Programs,%s)" % key)
         return
         
     self.stack = []
     self.__set_settings()
     self.__map_functions()
     
     self.open()
     self.close()
     
     Session().close()
Beispiel #3
0
    def __init__(self):
        Plugin.__init__(self)

        if self.state.refresh == True:
            self.state.refresh = False
            key = Key.build_url('program', words=self.state.__dict__)
            xbmc.executebuiltin("ReplaceWindow(Programs,%s)" % key)
            return

        self.stack = []
        self.__set_settings()
        self.__map_functions()

        self.open()
        self.close()

        Session().close()
Beispiel #4
0
    def _get_intro(self, id, arg=None):
        if True == True:

            if id == REGION:
                name = NEWS
                img = 'news.png'
            elif id == NEWS:
                name = NEWS
                img = 'news.png'
            elif id == SPORT:
                name = SPORT
                img = 'sport.png'
            elif id == SUPER:
                name = SUPER
                img = 'kids.png'
            elif id == NATURE:
                name = NATURE
                img = 'ntur.png'
            else:
                name = NEWS
                img = 'news.png'

            title = '%s %s' % (name, 'hovedvignett')
            img = Plugin.image(img)
            key = Key('new', type=PLAYLIST_VIGNETE)
            istart = MediaObj(title=title, thumbnail=img, key=key)
            istart.isPlayable = True
            istart.isFolder = False
            istart.url = Plugin.videopath(name + '_intro_main.avi')

            title = '%s %s' % (name, 'vignett')
            key = Key('new', type=PLAYLIST_VIGNETE)
            imid = MediaObj(title=title, thumbnail=img, key=key)
            imid.isPlayable = True
            imid.isFolder = False
            imid.url = Plugin.videopath(name + '_intro.avi')

            return istart, imid, istart

        else:
            url = uri.playlist(loop=id, type=arg)
            data = self.dman.get_data(url)
            if data:
                tmp_list = extract.playlist(data)
                return tmp_list[0], tmp_list[2], tmp_list[-1]
        def __init__( self, *args, **kwargs):
            if Key(sys.argv[2]).page: page = key.page
            else: page = 100
                
            self.action = None
            self.buttons = {}
            self.ttv = TTV(cache=True)
            self.ttv.page = page
            self.ttv.savepath = Plugin.get_cachepath()
            
            bg = self.ttv.create_background()
            xbmc.executebuiltin("Skin.SetString(bgimg, %s)" %bg)      

            self.image = LOADING_IMG
            self.pref = ''
Beispiel #6
0
 def _merge_playlists(cat, xml):
     mcount = 0
     icount = 0
     for i in xml:
         if i.key.type == PLAYLIST_VIGNETE:
             i.thumbnail = Plugin.image('news.png')
         elif i.key.type == PLAYLIST_ITEM:
             mcount -= 1
             try:
                 xml[icount].thumbnail = cat[mcount].thumbnail
                 xml[icount].plot = cat[mcount].plot
             except IndexError:
                 pass
         icount += 1
     return xml
Beispiel #7
0
        def __init__(self, *args, **kwargs):
            if Key(sys.argv[2]).page: page = key.page
            else: page = 100

            self.action = None
            self.buttons = {}
            self.ttv = TTV(cache=True)
            self.ttv.page = page
            self.ttv.savepath = Plugin.get_cachepath()

            bg = self.ttv.create_background()
            xbmc.executebuiltin("Skin.SetString(bgimg, %s)" % bg)

            self.image = LOADING_IMG
            self.pref = ''
Beispiel #8
0
 def _merge_playlists(cat, xml):
     mcount = 0
     icount = 0
     for i in xml:
         if i.key.type == PLAYLIST_VIGNETE:
             i.thumbnail = Plugin.image('news.png')  
         elif i.key.type == PLAYLIST_ITEM:
             mcount -= 1
             try:
                 xml[icount].thumbnail = cat[mcount].thumbnail
                 xml[icount].plot = cat[mcount].plot
             except IndexError:
                 pass
         icount += 1
     return xml
        del self.img
        
        return file

   

# Action Identificator constants
REMOTE_0 = 58;   REMOTE_1 = 59
REMOTE_2 = 60;   REMOTE_3 = 61
REMOTE_4 = 62;   REMOTE_5 = 63
REMOTE_6 = 64;   REMOTE_7 = 65
REMOTE_8 = 66;   REMOTE_9 = 67

EXIT_CODES = (9, 10, 216, 257, 275, 216, )

LOADING_IMG = Plugin.image('ttv_loading.png')
ERROR_IMG   = Plugin.image('ttv_notfound.png')


xbmc.executebuiltin("Skin.SetString(ttv-image, %s)" % LOADING_IMG )

        
if not DEBUG:
    class TTVDlg(xbmcgui.WindowXMLDialog):
        """ Show skinned Dialog with our information """
        
        XML = "teletext.xml"

        
        def __init__( self, *args, **kwargs):
            if Key(sys.argv[2]).page: page = key.page
from threading import Thread
from time import time
import urlparse
import httplib
import urllib
import utils
import sys
import os
import re



Log.out( "PLUGIN::LOADED -> '%s'" % __name__)


if (Plugin.get_platform() == utils.WINDOWS or 
    Plugin.get_platform() == utils.XBOX):
    Log.out('PLUGIN::IMPORT -> "cPickle" module')
    import cPickle as pickle
else: 
    Log.out('PLUGIN::IMPORT -> "pickle" module')
    import pickle  
    

NONE = 0; READ = 1; WRITE = 2; BINARY = 'b'; ASCII = ''



def file_exist(file):
    if os.path.isfile(file): return True
        
Beispiel #11
0
REMOTE_5 = 63
REMOTE_6 = 64
REMOTE_7 = 65
REMOTE_8 = 66
REMOTE_9 = 67

EXIT_CODES = (
    9,
    10,
    216,
    257,
    275,
    216,
)

LOADING_IMG = Plugin.image('ttv_loading.png')
ERROR_IMG = Plugin.image('ttv_notfound.png')

xbmc.executebuiltin("Skin.SetString(ttv-image, %s)" % LOADING_IMG)

if not DEBUG:

    class TTVDlg(xbmcgui.WindowXMLDialog):
        """ Show skinned Dialog with our information """

        XML = "teletext.xml"

        def __init__(self, *args, **kwargs):
            if Key(sys.argv[2]).page: page = key.page
            else: page = 100
from urllib import urlencode, splithost, quote, unquote, quote_plus, unquote_plus
from urllib2 import urlopen, Request, URLError
from urlparse import urlparse
from threading import Thread
from time import time
import urlparse
import httplib
import urllib
import utils
import sys
import os
import re

Log.out("PLUGIN::LOADED -> '%s'" % __name__)

if (Plugin.get_platform() == utils.WINDOWS
        or Plugin.get_platform() == utils.XBOX):
    Log.out('PLUGIN::IMPORT -> "cPickle" module')
    import cPickle as pickle
else:
    Log.out('PLUGIN::IMPORT -> "pickle" module')
    import pickle

NONE = 0
READ = 1
WRITE = 2
BINARY = 'b'
ASCII = ''


def file_exist(file):