def startService(): if not sutils.isFileExecutableByOwner(consts.script): sutils.addExecPermissions(execDir, True); smartmontools.checkConfigurationFilesExistance(); if addon.getSetting(consts.settingDBupdates ) == "true": smartmontools.updateDatabase(); if addon.getSetting(consts.settingRunDaemonOnStartup ) == "true": smartd.startDaemon(); if smartd.daemonRunning(): if addon.getSetting(consts.settingSmartdStartupPopup) == True: xbmc.executebuiltin("Notification(smartmontools, " + addon.getLocalizedString(50001)+ ", 7, " + icon + ")"); # smartd started else: xbmc.log(consts.logHeader + "failed to start smartd", xbmc.LOGERROR); xbmcgui.Dialog().ok(consts.dialogHeader, addon.getLocalizedString(50024));
def startService(): if not sutils.isFileExecutableByOwner(consts.script): sutils.addExecPermissions(execDir, True) smartmontools.checkConfigurationFilesExistance() if addon.getSetting(consts.settingDBupdates) == "true": smartmontools.updateDatabase() if addon.getSetting(consts.settingRunDaemonOnStartup) == "true": smartd.startDaemon() if smartd.daemonRunning(): if addon.getSetting(consts.settingSmartdStartupPopup) == True: xbmc.executebuiltin("Notification(smartmontools, " + addon.getLocalizedString(50001) + ", 7, " + icon + ")") # smartd started else: xbmc.log(consts.logHeader + "failed to start smartd", xbmc.LOGERROR) xbmcgui.Dialog().ok(consts.dialogHeader, addon.getLocalizedString(50024))
xbmc.log(msg="smartmontools plugin v " + addon.getAddonInfo("version"), level=xbmc.LOGDEBUG); xbmc.log(msg="smartmontools number of params: " + str(len(sys.argv)), level=xbmc.LOGDEBUG); xbmc.log(msg="smartmontools initial params: " + str(sys.argv), level=xbmc.LOGDEBUG); params = sutils.get_params(); xbmc.log(msg="smartmontools initial params:" + str(params), level=xbmc.LOGDEBUG); try: index = int(params[consts.paramIndex]); except: index = None; if index == None : # creates initial folder structured menu if sutils.isFileExecutableByOwner(consts.script): listDisks(); listSmartdTasks(); listOtherTasks(); else: s = consts.colorShadeOfRed + addon.getLocalizedString(50059) + consts.colorEnd; # restart of OL required addFolderItem(s, -99); xbmcplugin.endOfDirectory(int(sys.argv[1])); # Execute chosen task # indexes 1 - 20 are reserved for common smartd tasks elif index == 1: startSmartd(); sutilsxbmc.refreshCurrentListing(); elif index == 2:
level=xbmc.LOGDEBUG) xbmc.log(msg="smartmontools initial params: " + str(sys.argv), level=xbmc.LOGDEBUG) params = sutils.get_params() xbmc.log(msg="smartmontools initial params:" + str(params), level=xbmc.LOGDEBUG) try: index = int(params[consts.paramIndex]) except: index = None if index == None: # creates initial folder structured menu if sutils.isFileExecutableByOwner(consts.script): listDisks() listSmartdTasks() listOtherTasks() else: s = consts.colorShadeOfRed + addon.getLocalizedString( 50059) + consts.colorEnd # restart of OL required addFolderItem(s, -99) xbmcplugin.endOfDirectory(int(sys.argv[1])) # Execute chosen task # indexes 1 - 20 are reserved for common smartd tasks elif index == 1: startSmartd()