def checkServerState(self): ''' ''' printl("", self, "S") self.g_wolon = self.g_serverConfig.wol.value self.g_wakeserver = str(self.g_serverConfig.wol_mac.value) self.g_woldelay = int(self.g_serverConfig.wol_delay.value) connectionType = str(self.g_serverConfig.connectionType.value) if connectionType == "0": ip = "%d.%d.%d.%d" % tuple(self.g_serverConfig.ip.value) port = int(self.g_serverConfig.port.value) state = testPlexConnectivity(ip, port) elif connectionType == "2": #state = testInetConnectivity("http://my.plexapp.com") state = True else: state = testInetConnectivity() if state == True: stateText = "Online" else: stateText = "Offline" printl("Plexserver State: " + str(stateText), self, "I") if state == False: if self.g_wolon == True and connectionType == "0": self.session.openWithCallback(self.executeWakeOnLan, MessageBox, _("Plexserver seems to be offline. Start with Wake on Lan settings? \n\nPlease note: \nIf you press yes the spinner will run for " + str(self.g_woldelay) + " seconds. \nAccording to your settings."), MessageBox.TYPE_YESNO) else: self.session.open(MessageBox,_("Plexserver seems to be offline. Please check your your settings or connection!"), MessageBox.TYPE_INFO) else: self.getServerData() printl("", self, "C")
def checkWakeOnLan(self): ''' ''' printl("", self, "S") self.g_wolon = self.g_serverConfig.wol.value self.g_wakeserver = str(self.g_serverConfig.wol_mac.value) self.g_woldelay = int(self.g_serverConfig.wol_delay.value) if self.g_wolon == True: ip = "%d.%d.%d.%d" % tuple(self.g_serverConfig.ip.value) port = int(self.g_serverConfig.port.value) state = testPlexConnectivity(ip, port) if state == False: self.session.openWithCallback( self.executeWakeOnLan, MessageBox, _("Plexserver seems to be offline. Start with Wake on Lan settings? \n\nPlease note: \nIf you press yes the spinner will run for " + str(self.g_woldelay) + " seconds. \nAccording to your settings."), MessageBox.TYPE_YESNO) else: self.getServerData() else: self.getServerData() printl("", self, "C")
def checkServerState(self): printl("", self, "S") self.g_wolon = self.g_serverConfig.wol.value self.g_wakeserver = str(self.g_serverConfig.wol_mac.value) self.g_woldelay = int(self.g_serverConfig.wol_delay.value) connectionType = str(self.g_serverConfig.connectionType.value) if connectionType == "0": ip = "%d.%d.%d.%d" % tuple(self.g_serverConfig.ip.value) port = int(self.g_serverConfig.port.value) isOnline = testPlexConnectivity(ip, port) elif connectionType == "2": # state = testInetConnectivity("http://my.plexapp.com") isOnline = True else: isOnline = testInetConnectivity() if isOnline: stateText = "Online" else: stateText = "Offline" printl("Plexserver State: " + str(stateText), self, "I") if not isOnline: if self.g_wolon == True and connectionType == "0": if self.secondRun: self.showWakeMessage() else: self.onShown.append(self.showWakeMessage) else: if self.secondRun: self.showOfflineMessage() else: self.onShown.append(self.showOfflineMessage) else: self.getServerData() printl("", self, "C")
def checkWakeOnLan(self): ''' ''' printl("", self, "S") self.g_wolon = self.g_serverConfig.wol.value self.g_wakeserver = str(self.g_serverConfig.wol_mac.value) self.g_woldelay = int(self.g_serverConfig.wol_delay.value) if self.g_wolon == True: ip = "%d.%d.%d.%d" % tuple(self.g_serverConfig.ip.value) port = int(self.g_serverConfig.port.value) state = testPlexConnectivity(ip, port) if state == False: self.session.openWithCallback(self.executeWakeOnLan, MessageBox, _("Plexserver seems to be offline. Start with Wake on Lan settings? \n\nPlease note: \nIf you press yes the spinner will run for " + str(self.g_woldelay) + " seconds. \nAccording to your settings."), MessageBox.TYPE_YESNO) else: self.getServerData() else: self.getServerData() printl("", self, "C")