def stopSmartd(): if smartd.daemonRunning(): smartd.stopDaemon(); if not smartd.daemonRunning(): if showPopups: xbmc.executebuiltin("Notification(smartmontools, " + addon.getLocalizedString(50025)+ ", 7, " + icon + ")"); # smartd stopped else: xbmcgui.Dialog().ok(consts.dialogHeader, addon.getLocalizedString(50026)); # Failed to stop smartd
def startSmartd(): if not smartd.daemonRunning(): smartd.startDaemon(); if smartd.daemonRunning(): if showPopups: 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)); # Failed to start smartd
def stopSmartd(): if smartd.daemonRunning(): smartd.stopDaemon() if not smartd.daemonRunning(): if showPopups: xbmc.executebuiltin("Notification(smartmontools, " + addon.getLocalizedString(50025) + ", 7, " + icon + ")") # smartd stopped else: xbmcgui.Dialog().ok(consts.dialogHeader, addon.getLocalizedString(50026))
def listSmartdTasks(): addFolderItem(consts.fontBold + consts.colorBlue + addon.getLocalizedString(50012) + # smartd daemon tasks: consts.colorEnd + consts.fontBoldEnd, -99); if smartd.daemonRunning(): addFolderItem(addon.getLocalizedString(50013), 3); # reload configuration file addFolderItem(addon.getLocalizedString(50014), 4); # run test now addFolderItem(addon.getLocalizedString(50015), 2); # stop else: addFolderItem(addon.getLocalizedString(50016), 1); # start addFolderItem(addon.getLocalizedString(50017), 5); # show log
def startSmartd(): smartd.startDaemon() if smartd.daemonRunning(): if showPopups: 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));
def listSmartdTasks(): addFolderItem( consts.fontBold + consts.colorBlue + addon.getLocalizedString(50012) + # smartd daemon tasks: consts.colorEnd + consts.fontBoldEnd, -99) if smartd.daemonRunning(): addFolderItem(addon.getLocalizedString(50013), 3) # reload configuration file addFolderItem(addon.getLocalizedString(50014), 4) # run test now addFolderItem(addon.getLocalizedString(50015), 2) # stop else: addFolderItem(addon.getLocalizedString(50016), 1) # start addFolderItem(addon.getLocalizedString(50017), 5)
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))