Exemplo n.º 1
0
def creator():
    if os.path.exists(iniPath) and os.path.exists(
            addons_index_path) and not interval == INTERVAL_OFF:
        if interval <> INTERVAL_ALWAYS:
            modTime = datetime.datetime.fromtimestamp(
                os.path.getmtime(iniPath))
            td = datetime.datetime.now() - modTime
            diff = (td.microseconds +
                    (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
            if ((interval == INTERVAL_12 and diff >= 43200)
                    or (interval == INTERVAL_24 and diff >= 86400)
                    or (interval == INTERVAL_48 and diff >= 172800)
                    or (interval == INTERVAL_72 and diff >= 259200)
                    or (interval == INTERVAL_96 and diff >= 345600)
                    or (interval == INTERVAL_120 and diff >= 432000)):
                xbmc.executebuiltin(
                    'RunPlugin(plugin://plugin.video.IVUEcreator/update)')
            else:
                w = gui.TVGuide()
                w.doModal()
                del w
        else:
            xbmc.executebuiltin(
                'RunPlugin(plugin://plugin.video.IVUEcreator/update)')
    else:
        w = gui.TVGuide()
        w.doModal()
        del w
Exemplo n.º 2
0
def openMGuide():
   try:
       dialog = xbmcgui.DialogProgress()
       dialog.create('Pleat Wait!', 'Opening TV Guide Dixie...')
       dialog.update(0)
       dixie = xbmcaddon.Addon('script.tvguidedixie')
       path  = dixie.getAddonInfo('path') 
       sys.path.insert(0, os.path.join(path, ''))
       xbmc.executebuiltin('ActivateWindow(HOME)')
       dialog.update(33)
       dixie.setSetting('mashmode', 'true')
       import gui
       dialog.update(66)
       w = gui.TVGuide()
       dialog.update(100)
       dialog.close()
       w.doModal()
       del w
       

       cmd = 'AlarmClock(%s,RunAddon(%s),%d,True)' % ('Restart', addon_id, 0)
       
       xbmc.executebuiltin(cmd)
   except Exception, e:
       #print str(e)
       pass
Exemplo n.º 3
0
def changeListings():
    gui.close()
    ADDON.openSettings(ADDON)
    xbmc.executebuiltin('XBMC.ActivateWindow(home)')
    w = gui.TVGuide()

    w.doModal()
    del w

    changeListings()
Exemplo n.º 4
0
def main():
    try:
        readfile = open(chanxml, 'r')
        content = readfile.read()
        readfile.close()
    except:
        content = ''

    channels = re.compile('<channel id="(.+?)"').findall(content)
    totalchans = len(channels)
    weight = len(os.listdir(chanpath))

    for channel in channels:
        channel = channel.replace(' ', '_').replace('+', '_PLUS').replace(
            '*', 'STAR').replace('&amp;', '&').replace('\/', '&')
        filepath = os.path.join(chanpath, channel)

        if not os.path.exists(filepath):
            weight += 1
            chanlogo = os.path.join(logofolder, 'default.png')
            writefile = open(filepath, 'w')
            writefile.write(channel + '\n' + channel + '\n' + chanlogo + '\n' +
                            '\n' + '1\n' + str(weight) + '\n' +
                            'Uncategorised\n0\n\n0\n')
            writefile.close()

# If we only want to show channels that exist in db (with EPG data)
    if showEPGonly == 'true':
        Filter_EPG_Only()

# If we only want to show channels that exist in the ini file(s)
    if inichansonly == 'true':
        Filter_Valid_Ini_Only()

# If we want to add SF items
    if add_sf_items == 'true':
        sf_check(channels, weight)

# Check to see if any new categories have been set
    check_cats()
    xbmc.executebuiltin("Dialog.Close(busydialog)")
    w = gui.TVGuide()
    w.doModal()
    del w
    xbmcgui.Window(10000).clearProperty('OTT_RUNNING')
    xbmcgui.Window(10000).clearProperty('OTT_WINDOW')
Exemplo n.º 5
0
def main(doLogin=True):
    import message
    dixie.CheckUsername()
    dixie.ShowBusy()
    CheckChanXML()

    import gui

    try:
        if not dixie.validToRun():
            dixie.CloseBusy()
            dixie.notify('Failed to obtain a response from On-Tapp.TV')
            return

        CheckPlugin()
        CheckVersion()
        CheckIniVersion()
        CheckFilmOn()
        CheckForUpdate()
        CheckForChannels()

        dixie.log('****** On-Tapp.EPG - All OK *******')

        message.check()
        dixie.CloseBusy()

        xbmcgui.Window(10000).setProperty('OTT_RUNNING', 'True')

        w = gui.TVGuide()

        CopyKeymap()
        w.doModal()
        RemoveKeymap()
        del w

        xbmcgui.Window(10000).clearProperty('OTT_RUNNING')
        xbmcgui.Window(10000).clearProperty('OTT_WINDOW')

    except Exception:
        raise
Exemplo n.º 6
0
    channel = sys.argv[3]
ADDON.setSetting('channel.arg', channel)

assets = [
    ('special://profile/addon_data/script.tvguide.fullscreen/backgrounds/sunburst.png',
     'https://raw.githubusercontent.com/primaeval/assets/master/backgrounds/sunburst.png'
     ),
    ('special://profile/addon_data/script.tvguide.fullscreen/backgrounds/charcoal.png',
     'https://raw.githubusercontent.com/primaeval/assets/master/backgrounds/charcoal.png'
     ),
]
if ADDON.getAddonInfo('id').endswith('fullscreen'):
    for (dst, src) in assets:
        if not xbmcvfs.exists(dst):
            xbmcvfs.copy(src, dst)

xbmcvfs.copy(
    'special://home/addons/script.tvguide.fullscreen/resources/actions.json',
    'special://profile/addon_data/script.tvguide.fullscreen/actions.json')

try:
    import gui
    w = gui.TVGuide()
    w.doModal()
    del w

except:
    import sys
    import traceback as tb
    (etype, value, traceback) = sys.exc_info()
    tb.print_exception(etype, value, traceback)
Exemplo n.º 7
0
def main(doLogin=True):
    busy = None
    try:
        busy = xbmcgui.WindowXMLDialog('DialogBusy.xml', '')
        busy.show()

        try:    busy.getControl(10).setVisible(False)
        except: pass

    except:
        busy = None

    import buggalo
    import gui

    buggalo.GMAIL_RECIPIENT = '*****@*****.**'

        
    try:
        if doLogin:
            url      = dixie.GetDixieUrl(DIXIEURL) + 'update.txt'
            code     = session.doLogin()
            response = session.checkFiles(url)
        else:
            code = 200
            response = ''
            
        if code == 503:
            d = xbmcgui.Dialog()
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % code, 'Something went wrong with your login', 'Please check your settings.')
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % code, 'Daily IP Address limit reached.', 'Restricted for 2 hours.')
            print '****** OnTapp.TV Error 503. Too many login attempts/IPs exceeded *******'
            return
        
        if response == 401:
            d = xbmcgui.Dialog()
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % response, 'Something went wrong with your login', 'Check your settings, or subscribe at www.on-tapp.tv.')
            print '****** OnTapp.TV Error 401. Access Denied. Not a paid member. *******'
            return
        
        if response == 301:
            xbmc.executebuiltin('XBMC.RunScript($CWD/deleteDB.py)')
            d = xbmcgui.Dialog()
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % response, 'It looks like you do not have a paid subcription.', 'Check your settings, or subscribe at www.on-tapp.tv.')
            print '****** OnTapp.TV Error 301. Free member. No paid subscription. *******'
            return

        if doLogin:
            # CheckDixieURL()
            CheckVersion()
            GetChannels()
            GetCats()
            CheckSkin()
            CheckSkinVersion()
            CheckIniVersion()
            CheckForUpdate()
            CheckForChannels()

        print '****** OnTapp.TV - All OK *******'

        xbmcgui.Window(10000).setProperty('OTT_RUNNING', 'True')
        xbmc.executebuiltin('XBMC.ActivateWindow(home)')

        w = gui.TVGuide()

        if busy:
           busy.close()
           busy = None

        CopyKeymap()
        w.doModal()
        RemoveKeymap()
        del w

        xbmcgui.Window(10000).clearProperty('OTT_RUNNING')

    except Exception:
       buggalo.onExceptionRaised()
Exemplo n.º 8
0
Arquivo: addon.py Projeto: yogi81/ru
import xbmc
import xbmcaddon

import source
import gui

ADDON = xbmcaddon.Addon(id='script.yandex.tvguide')

if __name__ == '__main__':
    w = gui.TVGuide(
        source.XMLYandex(
            {'cache.path': xbmc.translatePath(ADDON.getAddonInfo('profile'))}))
    w.doModal()
    del w
Exemplo n.º 9
0
def main(doLogin=True):
    busy = None
    try:
        busy = xbmcgui.WindowXMLDialog('DialogBusy.xml', '')
        busy.show()

        try:    busy.getControl(10).setVisible(False)
        except: pass

    except:
        busy = None

    import buggalo
    import gui

    buggalo.GMAIL_RECIPIENT = '*****@*****.**'
        
    try:
        if doLogin:
            url      = dixie.GetDixieUrl(DIXIEURL) + 'update.txt'
            code     = session.doLogin()
            response = session.checkFiles(url)
        else:
            code = 200
            response = ''
            
        if code == 503:
            d = xbmcgui.Dialog()
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % code, 'Something went wrong with your login', 'Please check your settings.')
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % code, 'Daily IP Address limit reached.', 'Restricted for 2 hours.')
            return
        
        if response == 401:
            d = xbmcgui.Dialog()
            d.ok(TITLE + ' Error', 'OnTapp.TV failed with error code - %s.' % response, 'Something went wrong with your login', 'You will now get Basic Channels.')
            d.ok(TITLE + ' Error - %s.' % response, 'OnTapp.TV failed to log in', 'Check your settings.', 'Please subscribe at www.on-tapp.tv.')
            dixie.SetSetting('dixie.url', 'Basic Channels')
            dixie.SetSetting('DIXIEURL', 'Basic Channels')
            return
            
        else:
            # if doLogin:
            #     xbmcgui.Dialog().ok(TITLE + ' Status', 'Status - %s' % response, 'Login OK.', 'Thank you.')
            CheckDixieURL()
            CheckVersion()
            GetCats()
            CheckSkin()
            CheckSkinVersion()
            CheckIniVersion()
            CheckForUpdate()
        
            xbmcgui.Window(10000).setProperty('OTT_RUNNING', 'True')
            xbmc.executebuiltin('XBMC.ActivateWindow(home)')
        
            w = gui.TVGuide()
        
            if busy:
               busy.close()
               busy = None
           
            CopyKeymap()
            w.doModal()
            RemoveKeymap()
            del w
        
            xbmcgui.Window(10000).clearProperty('OTT_RUNNING')

    except Exception:
       buggalo.onExceptionRaised()