2019-08-27 15:01:24 -05:00
|
|
|
from kodi_six import xbmc, xbmcgui, xbmcaddon
|
2012-09-05 14:28:43 -05:00
|
|
|
|
|
|
|
__addon_id__= 'script.xbmcbackup'
|
|
|
|
__Addon = xbmcaddon.Addon(__addon_id__)
|
|
|
|
|
2012-09-13 09:52:17 -05:00
|
|
|
def data_dir():
|
|
|
|
return __Addon.getAddonInfo('profile')
|
|
|
|
|
2012-10-26 09:17:21 -05:00
|
|
|
def addon_dir():
|
|
|
|
return __Addon.getAddonInfo('path')
|
|
|
|
|
2013-12-05 14:26:35 -06:00
|
|
|
def openSettings():
|
|
|
|
__Addon.openSettings()
|
|
|
|
|
2019-08-26 15:40:15 -05:00
|
|
|
def log(message,loglevel=xbmc.LOGDEBUG):
|
2019-08-27 14:56:54 -05:00
|
|
|
xbmc.log(__addon_id__ + "-" + __Addon.getAddonInfo('version') + ": " + message,level=loglevel)
|
2012-09-05 14:28:43 -05:00
|
|
|
|
2012-09-06 15:28:41 -05:00
|
|
|
def showNotification(message):
|
2019-08-27 14:56:54 -05:00
|
|
|
xbmcgui.Dialog().notification(getString(30010),message,time=4000,icon=xbmc.translatePath(__Addon.getAddonInfo('path') + "/resources/images/icon.png"))
|
2012-09-06 15:28:41 -05:00
|
|
|
|
2012-09-05 14:28:43 -05: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)
|
|
|
|
|
2019-08-26 15:40:15 -05:00
|
|
|
def getRegionalTimestamp(date_time,dateformat=['dateshort']):
|
|
|
|
result = ''
|
|
|
|
|
|
|
|
for aFormat in dateformat:
|
|
|
|
result = result + ("%s " % date_time.strftime(xbmc.getRegion(aFormat)))
|
|
|
|
|
|
|
|
return result.strip()
|
|
|
|
|