2012-09-05 21:28:43 +02:00
|
|
|
import xbmc
|
|
|
|
import xbmcaddon
|
|
|
|
|
|
|
|
__addon_id__= 'script.xbmcbackup'
|
|
|
|
__Addon = xbmcaddon.Addon(__addon_id__)
|
|
|
|
|
2012-09-13 16:52:17 +02:00
|
|
|
def data_dir():
|
|
|
|
return __Addon.getAddonInfo('profile')
|
|
|
|
|
2012-10-26 16:17:21 +02:00
|
|
|
def addon_dir():
|
|
|
|
return __Addon.getAddonInfo('path')
|
|
|
|
|
2012-09-05 21:28:43 +02:00
|
|
|
def log(message,loglevel=xbmc.LOGNOTICE):
|
|
|
|
xbmc.log(encode(__addon_id__ + ": " + message),level=loglevel)
|
|
|
|
|
2012-09-06 22:28:41 +02:00
|
|
|
def showNotification(message):
|
2013-10-01 20:22:03 +02:00
|
|
|
xbmc.executebuiltin("Notification(" + encode(getString(30010)) + "," + encode(message) + ",4000," + xbmc.translatePath(__Addon.getAddonInfo('path') + "/icon.png") + ")")
|
2012-09-06 22:28:41 +02:00
|
|
|
|
2012-09-05 21:28:43 +02:00
|
|
|
def getSetting(name):
|
|
|
|
return __Addon.getSetting(name)
|
|
|
|
|
|
|
|
def setSetting(name,value):
|
|
|
|
__Addon.setSetting(name,value)
|
|
|
|
|
|
|
|
def getString(string_id):
|
|
|
|
return __Addon.getLocalizedString(string_id)
|
|
|
|
|
|
|
|
def encode(string):
|
|
|
|
return string.encode('UTF-8','replace')
|