Beispiel #1
0
        xbmc.sleep(200)
        xbmc.executebuiltin('XBMC.Action(reloadkeymaps)')

    def unloadKeymap(self):

        path = xbmc.translatePath('special://profile/keymaps/zattooKeymap.xml')
        if os.path.isfile(path):
            try:
                os.remove(path)
                xbmc.sleep(200)
                xbmc.executebuiltin('XBMC.Action(reloadkeymaps)')
            except:
                pass


###########################################################################################
debug('Service started')
player = myPlayer()

if OLDVERSION != VERSION:
    _zattooDB_.reloadDB(False)
    _zattooDB_.set_version(VERSION)

elif __addon__.getSetting('dbonstart') == 'true':
    start()
try:
    getProgNextDay()
except:
    pass
refreshProg()
Beispiel #2
0
      source = __addondir__ + '/zattooKeymap.xml'
      dest = xbmc.translatePath('special://profile/keymaps/zattooKeymap.xml')
      if os.path.isfile(dest): return
      with open(source, 'r') as file: content = file.read()
      with open(dest, 'w') as file: file.write(content)
      xbmc.sleep(200)
      xbmc.executebuiltin('XBMC.Action(reloadkeymaps)')

    def unloadKeymap(self):
      
      path=xbmc.translatePath('special://profile/keymaps/zattooKeymap.xml')
      if os.path.isfile(path):
        try:
          os.remove(path)
          xbmc.sleep(200)
          xbmc.executebuiltin('XBMC.Action(reloadkeymaps)')
        except:pass
        
###########################################################################################
debug('Service started')
player=myPlayer()

if OLDVERSION != VERSION:
   _zattooDB_.reloadDB(True)
   _zattooDB_.set_version(VERSION)

start()
    
refreshProg()

accountData = _zattooDB_.zapi.get_accountData()
premiumUser = accountData['account']['subscriptions'] != []

DASH = __addon__.getSetting('dash') == 'true'
RECREADY = __addon__.getSetting('rec_ready')
VERSION = __addon__.getAddonInfo('version')
OLDVERSION = _zattooDB_.get_version(VERSION)
DEBUG = __addon__.getSetting('debug')
KEYMAP = __addon__.getSetting('keymap')

#reload DB on Update
#print "Old Version: " + str(OLDVERSION)
#print "Version: " + str(VERSION)
if OLDVERSION != VERSION:
    _zattooDB_.set_version(VERSION)
    _zattooDB_.reloadDB()

if SWISS == "true": xbmc.executebuiltin("Skin.SetBool(%s)" % 'swiss')
else: xbmc.executebuiltin("Skin.Reset(%s)" % 'swiss')

if premiumUser: xbmc.executebuiltin("Skin.SetBool(%s)" % 'hiq')
else: xbmc.executebuiltin("Skin.Reset(%s)" % 'hiq')

# get Timezone Offset
from tzlocal import get_localzone
import pytz
try:
    tz = get_localzone()
    offset = tz.utcoffset(datetime.datetime.now()).total_seconds()
    _timezone_ = int(offset)
except: