From a5ae54011004106657a014e1e37d044cc4a87e7e Mon Sep 17 00:00:00 2001 From: DonDavici Date: Sun, 2 Nov 2014 22:33:33 +0100 Subject: [PATCH] made dreamplex dm7080 deb compatible --- src/DPH_StillPicture.py | 8 ++- src/DP_Player.py | 27 +++++++-- src/DP_Syncer.py | 17 ++++-- src/DP_SystemCheck.py | 130 ++++++++++++++++++++-------------------- src/DP_View.py | 33 ++++++++-- src/__common__.py | 125 ++++++++++++++++++++++---------------- src/plugin.py | 26 ++++++-- 7 files changed, 227 insertions(+), 139 deletions(-) diff --git a/src/DPH_StillPicture.py b/src/DPH_StillPicture.py index a21ad9f8..af574cf5 100644 --- a/src/DPH_StillPicture.py +++ b/src/DPH_StillPicture.py @@ -30,7 +30,7 @@ from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase from Components.config import config -from __common__ import printl2 as printl, getBoxInformation +from __common__ import printl2 as printl, getBoxInformation, getOeVersion #=============================================================================== # @@ -188,7 +188,11 @@ def __init__(self, session): self.showiframe = Showiframe() self.session = session self.poll_timer = eTimer() - self.poll_timer.callback.append(self.poll) + + if getOeVersion() != "oe22": + self.poll_timer.callback.append(self.poll) + else: + self.poll_timerConn = self.poll_timer.timeout.connect(self.poll) printl("", self, "C") diff --git a/src/DP_Player.py b/src/DP_Player.py index 034641b8..198e4978 100755 --- a/src/DP_Player.py +++ b/src/DP_Player.py @@ -32,7 +32,6 @@ from Screens.MinuteInput import MinuteInput from Screens.ChoiceBox import ChoiceBox from Screens.HelpMenu import HelpableScreen -from Screens.AudioSelection import AudioSelection from Tools.ISO639 import LanguageCodes #noinspection PyUnresolvedReferences @@ -61,7 +60,7 @@ from DP_Summary import DreamplexPlayerSummary from DPH_ScreenHelper import DPH_ScreenHelper -from __common__ import printl2 as printl, convertSize, encodeThat +from __common__ import printl2 as printl, convertSize, encodeThat, getOeVersion from __init__ import _ # _ is translation #=============================================================================== @@ -418,7 +417,10 @@ def setPoster(self): if self.whatPoster is None: self.buildPosterData() - self.EXpicloadPoster.startDecode(self.whatPoster,0,0,False) + if getOeVersion() != "oe22": + self.EXpicloadPoster.startDecode(self.whatPoster,0,0,False) + else: + self.EXpicloadPoster.startDecode(self.whatPoster,False) self.ptr = self.EXpicloadPoster.getData() @@ -578,7 +580,11 @@ def startSubtitleWatcher(self): printl("", self, "S") self.subtitleWatcher = eTimer() - self.subtitleWatcher.callback.append(self.subtitleChecker) + + if getOeVersion() != "oe22": + self.subtitleWatcher.callback.append(self.subtitleChecker) + else: + self.subtitleWatcherConn = self.subtitleWatcher.timeout.connect(self.subtitleChecker) printl("", self, "C") @@ -666,7 +672,11 @@ def startTimelineWatcher(self): printl("", self, "S") self.timelineWatcher = eTimer() - self.timelineWatcher.callback.append(self.updateTimeline) + + if getOeVersion() != "oe22": + self.timelineWatcher.callback.append(self.updateTimeline) + else: + self.timelineWatcherConn = self.timelineWatcher.timeout.connect(self.updateTimeline) if self.multiUserServer: printl("we are a multiuser server", self, "D") @@ -682,7 +692,12 @@ def pauseService(self): if self.playbackType == "1" and self.universalTranscoder: self.transcoderHeartbeat = eTimer() - self.transcoderHeartbeat.callback.append(self.keepTranscoderAlive) + + if getOeVersion() != "oe22": + self.transcoderHeartbeat.callback.append(self.keepTranscoderAlive) + else: + self.transcoderHeartbeatConn = self.transcoderHeartbeat.timeout.connect(self.keepTranscoderAlive) + self.transcoderHeartbeat.start(10000,False) self.timelineWatcher.stop() diff --git a/src/DP_Syncer.py b/src/DP_Syncer.py index 8aca3446..f6d2d44e 100644 --- a/src/DP_Syncer.py +++ b/src/DP_Syncer.py @@ -49,7 +49,7 @@ from DPH_Singleton import Singleton from DPH_ScreenHelper import DPH_ScreenHelper -from __common__ import printl2 as printl, isValidSize, encodeThat, getSkinResolution +from __common__ import printl2 as printl, isValidSize, encodeThat, getSkinResolution, getOeVersion from __init__ import _ # _ is translation #=========================================================================== @@ -387,8 +387,13 @@ def startSyncing(self): if not self.running: self.backgroundMediaSyncer = BackgroundMediaSyncer() - self.backgroundMediaSyncer.MessagePump.recv_msg.get().append(self.gotThreadMsg) - self.backgroundMediaSyncer.ProgressPump.recv_msg.get().append(self.gotThreadProgressMsg) + if getOeVersion() != "oe22": + self.backgroundMediaSyncer.MessagePump.recv_msg.get().append(self.gotThreadMsg) + self.backgroundMediaSyncer.ProgressPump.recv_msg.get().append(self.gotThreadProgressMsg) + else: + self.backgroundMediaSyncerConn = self.backgroundMediaSyncer.MessagePump.recv_msg.connect(self.gotThreadMsg) + self.backgroundMediaSyncerConn = self.backgroundMediaSyncer.ProgressPump.recv_msg.connect(self.gotThreadProgressMsg) + self.backgroundMediaSyncer.setMode(self.mode) if self.mode == "sync": @@ -413,7 +418,11 @@ def gotThreadMsg(self, msg): if msg[0] == THREAD_FINISHED: # clean up - self.backgroundMediaSyncer.MessagePump.recv_msg.get().remove(self.gotThreadMsg) + if getOeVersion() != "oe22": + self.backgroundMediaSyncer.MessagePump.recv_msg.get().remove(self.gotThreadMsg) + else: + self.backgroundMediaSyncerConn = None + self.callback = None #self.backgroundMediaSyncer = None # this throws a green screen. dont know why self.running = False diff --git a/src/DP_SystemCheck.py b/src/DP_SystemCheck.py index f75e76d8..71b254f3 100644 --- a/src/DP_SystemCheck.py +++ b/src/DP_SystemCheck.py @@ -38,7 +38,7 @@ from Screens.Screen import Screen from Screens.Console import Console as SConsole -from __common__ import printl2 as printl, testInetConnectivity, getUserAgentHeader +from __common__ import printl2 as printl, testInetConnectivity, getUserAgentHeader, getBoxArch, getOeVersion from __init__ import getVersion, _ # _ is translation @@ -47,7 +47,7 @@ #=============================================================================== class DPS_SystemCheck(Screen): - oeVersion = None + archVersion = None check = None latestVersion = None @@ -65,12 +65,12 @@ def __init__(self, session): vlist = [] - self.oeVersion = self.getBoxArch() + self.archVersion = getBoxArch() - if self.oeVersion == "mipsel": + if self.archVersion == "mipsel": vlist.append((_("Check for gst-plugin-fragmented"), "oe16")) - elif self.oeVersion == "mips32el": + elif self.archVersion == "mips32el": vlist.append((_("Check for gst-plugins-bad-fragmented"), "oe20")) else: @@ -243,9 +243,12 @@ def startUpdate(self, answer): def updateToLatestVersion(self): printl("", self, "S") - remoteUrl = "http://dl.bintray.com/dondavici/Dreambox/enigma2-plugin-extensions-dreamplex_" + str(self.latestVersion) + "_all.ipk?direct" - - cmd = "opkg install --force-overwrite --force-depends " + str(remoteUrl) + if getOeVersion() != "oe22": + remoteUrl = "http://dl.bintray.com/dondavici/Dreambox/enigma2-plugin-extensions-dreamplex_" + str(self.latestVersion) + "_all.ipk?direct" + cmd = "opkg install --force-overwrite --force-depends " + str(remoteUrl) + else: + remoteUrl = "http://dl.bintray.com/dondavici/Dreambox/enigma2-plugin-extensions-dreamplex_" + str(self.latestVersion) + "_all.deb?direct" + cmd = "dpkg --install " + str(remoteUrl) + " && apt-get update && apt-get -f install" printl("remoteUrl: " + str(remoteUrl), self, "D") printl("cmd: " + str(cmd), self, "D") @@ -289,7 +292,10 @@ def e2restart(self, answer): def checkOpensslInstallation(self, override=False): printl("", self, "S") - command = "opkg status python-pyopenssl" + if getOeVersion() != "oe22": + command = "opkg status python-pyopenssl" + else: + command = "dpkg -s python-pyopenssl" self.check = "openssl" state = self.executeCommand(command, override) @@ -303,7 +309,10 @@ def checkOpensslInstallation(self, override=False): def checkJpegToolsInstallation(self): printl("", self, "S") - command = "opkg status mjpegtools" + if getOeVersion() != "oe22": + command = "opkg status mjpegtools" + else: + command = "dpkg -s mjpegtools" self.check = "jpegTools" state = self.executeCommand(command) @@ -317,7 +326,10 @@ def checkJpegToolsInstallation(self): def checkPythonImagingInstallation(self): printl("", self, "S") - command = "opkg status python-imaging" + if getOeVersion() != "oe22": + command = "opkg status python-imaging" + else: + command = "dpkg -s python-imaging" self.check = "pythonImaging" state = self.executeCommand(command) @@ -331,7 +343,10 @@ def checkPythonImagingInstallation(self): def checkPythonTextutils(self): printl("", self, "S") - command = "opkg status python-textutils" + if getOeVersion() != "oe22": + command = "opkg status python-textutils" + else: + command = "dpkg -s python-textutils" self.check = "pythonTextutils" state = self.executeCommand(command) @@ -349,11 +364,14 @@ def checkLib(self, arch): if arch == "oe16": command = "opkg status gst-plugin-fragmented" - self.oeVersion = "mipsel" + self.archVersion = "mipsel" elif arch == "oe20": - command = "opkg status gst-plugins-bad-fragmented" - self.oeVersion = "mips32el" + if getOeVersion() != "oe22": + command = "opkg status gst-plugins-bad-fragmented" + else: + command = "dpkg -s gst-plugins-bad-fragmented" + self.archVersion = "mips32el" else: printl("someting went wrong with arch type", self, "W") @@ -415,11 +433,15 @@ def installOpensslLibs(self, confirm): if confirm: # User said 'Yes' - if self.oeVersion == "mipsel": + if self.archVersion == "mipsel": command = "opkg update; opkg install python-pyopenssl" - elif self.oeVersion == "mips32el": - command = "opkg update; opkg install python-pyopenssl" + elif self.archVersion == "mips32el": + + if getOeVersion() != "oe22": + command = "opkg update; opkg install python-pyopenssl" + else: + command = "apt-get update && apt-get install python-pyopenssl --force-yes -y" else: printl("something went wrong finding out the oe-version", self, "W") @@ -457,11 +479,14 @@ def installJpegToolsLibs(self, confirm): if confirm: # User said 'Yes' - if self.oeVersion == "mipsel": + if self.archVersion == "mipsel": command = "opkg update; opkg install mjpegtools" - elif self.oeVersion == "mips32el": - command = "opkg update; opkg install mjpegtools" + elif self.archVersion == "mips32el": + if getOeVersion() != "oe22": + command = "opkg update; opkg install mjpegtools" + else: + command = "apt-get update && apt-get install mjpegtools --force-yes -y" else: printl("something went wrong finding out the oe-version", self, "W") @@ -484,11 +509,14 @@ def installPyhtonImagingLibs(self, confirm): if confirm: # User said 'Yes' - if self.oeVersion == "mipsel": + if self.archVersion == "mipsel": command = "opkg update; opkg install python-imaging" - elif self.oeVersion == "mips32el": - command = "opkg update; opkg install python-imaging" + elif self.archVersion == "mips32el": + if getOeVersion() != "oe22": + command = "opkg update; opkg install python-imaging" + else: + command = "apt-get update && apt-get install python-imaging --force-yes -y" else: printl("something went wrong finding out the oe-version", self, "W") @@ -512,11 +540,14 @@ def installPyhtonTextutilsLibs(self, confirm): if confirm: # User said 'Yes' - if self.oeVersion == "mipsel": + if self.archVersion == "mipsel": command = "opkg update; opkg install python-textutils" - elif self.oeVersion == "mips32el": - command = "opkg update; opkg install python-textutils" + elif self.archVersion == "mips32el": + if getOeVersion() != "oe22": + command = "opkg update; opkg install python-textutils" + else: + command = "apt-get update && apt-get install python-textutils --force-yes -y" else: printl("something went wrong finding out the oe-version", self, "W") @@ -540,11 +571,14 @@ def installStreamingLibs(self, confirm): if confirm: # User said 'Yes' - if self.oeVersion == "mipsel": + if self.archVersion == "mipsel": command = "opkg update; opkg install gst-plugin-fragmented" - elif self.oeVersion == "mips32el": - command = "opkg update; opkg install gst-plugins-bad-fragmented" + elif self.archVersion == "mips32el": + if getOeVersion() != "oe22": + command = "opkg update; opkg install gst-plugins-bad-fragmented" + else: + command = "apt-get update && apt-get install gst-plugins-bad-fragmented --force-yes -y" else: printl("something went wrong finding out the oe-version", self, "W") @@ -563,22 +597,7 @@ def installStreamingLibs(self, confirm): def executeInstallationCommand(self, command): printl("", self, "S") - if not system(command): - # Successfully installed - #defaultServer = plexServerConfig.getDefaultServer() - #self.openSectionlist(defaultServer) - pass - else: - # Fail, try again and report the output... - pipe = popen(command) - if pipe is not None: - data = pipe.read(8192) - if data is None: - data = "Unknown Error" - pipe.close() - self.session.open(MessageBox, _("Could not install "+ command + ":\n") + data, MessageBox.TYPE_ERROR) - # Failed to install - self.cancel() + self.session.open(SConsole,"Excecuting command:", [command] , self.finishupdate) printl("", self, "C") @@ -590,21 +609,4 @@ def cancel(self): self.close(False,self.session) - printl("", self, "C") - - #=========================================================================== - # - #=========================================================================== - def getBoxArch(self): - printl("", self, "S") - - ARCH = "unknown" - - if (2, 6, 8) > sys.version_info > (2, 6, 6): - ARCH = "mipsel" - - if (2, 7, 4) > sys.version_info > (2, 7, 0): - ARCH = "mips32el" - - printl("", self, "C") - return ARCH \ No newline at end of file + printl("", self, "C") \ No newline at end of file diff --git a/src/DP_View.py b/src/DP_View.py index 8ce049c0..97473951 100755 --- a/src/DP_View.py +++ b/src/DP_View.py @@ -58,7 +58,7 @@ from DPH_ScreenHelper import DPH_ScreenHelper, DPH_MultiColorFunctions, DPH_Screen from DP_ViewFactory import getNoneDirectoryElements, getDefaultDirectoryElementsList, getGuiElements -from __common__ import printl2 as printl, loadPicture, durationToTime, getLiveTv, encodeThat +from __common__ import printl2 as printl, loadPicture, durationToTime, getLiveTv, encodeThat, getOeVersion from __plugin__ import Plugin from __init__ import _ # _ is translation @@ -1986,7 +1986,12 @@ def handleBackdrop(self): printl("showing backdrop with timeout ...", self, "D") # we use this to give enough time to jump through the list before we start encoding pics and reading all the data that have to be switched = SPEEDUP :-) self.refreshTimer = eTimer() - self.refreshTimer.callback.append(self.showBackdrop) + + if getOeVersion() != "oe22": + self.refreshTimer.callback.append(self.showBackdrop) + else: + self.refreshTimerConn = self.refreshTimer.timeout.connect(self.showBackdrop) + self.refreshTimer.start(500, True) printl("", self, "C") @@ -2328,7 +2333,11 @@ def showPoster(self, forceShow = False): if forceShow: if self.whatPoster is not None: - self.EXpicloadPoster.startDecode(self.whatPoster,0,0,False) + if getOeVersion() != "oe22": + self.EXpicloadPoster.startDecode(self.whatPoster,0,0,False) + else: + self.EXpicloadPoster.startDecode(self.whatPoster,False) + ptr = self.EXpicloadPoster.getData() if ptr is not None: @@ -2338,7 +2347,11 @@ def showPoster(self, forceShow = False): if fileExists(self.whatPoster): if self.whatPoster is not None: - self.EXpicloadPoster.startDecode(self.whatPoster,0,0,False) + if getOeVersion() != "oe22": + self.EXpicloadPoster.startDecode(self.whatPoster,0,0,False) + else: + self.EXpicloadPoster.startDecode(self.whatPoster,False) + ptr = self.EXpicloadPoster.getData() if ptr is not None: @@ -2360,7 +2373,11 @@ def showBackdrop(self, forceShow = False): if forceShow: if self.whatBackdrop is not None: - self.EXpicloadBackdrop.startDecode(self.whatBackdrop,0,0,False) + if getOeVersion() != "oe22": + self.EXpicloadBackdrop.startDecode(self.whatBackdrop,0,0,False) + else: + self.EXpicloadBackdrop.startDecode(self.whatBackdrop,False) + ptr = self.EXpicloadBackdrop.getData() if ptr is not None: @@ -2370,7 +2387,11 @@ def showBackdrop(self, forceShow = False): if fileExists(self.whatBackdrop): if self.whatBackdrop is not None: - self.EXpicloadBackdrop.startDecode(self.whatBackdrop,0,0,False) + if getOeVersion() != "oe22": + self.EXpicloadBackdrop.startDecode(self.whatBackdrop,0,0,False) + else: + self.EXpicloadBackdrop.startDecode(self.whatBackdrop,False) + ptr = self.EXpicloadBackdrop.getData() if ptr is not None: diff --git a/src/__common__.py b/src/__common__.py index 9d14679f..959018ed 100755 --- a/src/__common__.py +++ b/src/__common__.py @@ -63,10 +63,12 @@ skinDebugMode = False skinHighlightedColor = "#e69405" skinNormalColor = "#ffffff" -gBoxType = None +g_boxData = None screens = [] liveTv = None g_uuid = None +g_oeVersion = None +g_archType = None STARTING_MESSAGE = ">>>>>>>>>>" CLOSING_MESSAGE = "<<<<<<<<<<" #=============================================================================== @@ -478,17 +480,12 @@ def getBoxInformation(): @return: manu, model, arch, version """ printl2("", "__common__::getBoxtype", "S") - global gBoxType - if gBoxType is not None: + if g_boxData is None: + setBoxInformation() - printl2("", "__common__::getBoxtype", "C") - return gBoxType - else: - gBoxType = setBoxInformation() - - printl2("", "__common__::getBoxtype", "C") - return gBoxType + printl2("", "__common__::getBoxtype", "C") + return g_boxData #=============================================================================== # @@ -525,7 +522,6 @@ def setBoxInformation(): pass manu = "unknown" - arch = "unknown" model = "unkown" if success: @@ -535,147 +531,172 @@ def setBoxInformation(): if box == "ufs910": manu = "Kathrein" model = "UFS-910" - arch = "sh4" elif box == "ufs912": manu = "Kathrein" model = "UFS-912" - arch = "sh4" elif box == "ufs922": manu = "Kathrein" model = "UFS-922" - arch = "sh4" elif box == "solo": manu = "VU+" model = "Solo" - arch = "mipsel" elif box == "duo": manu = "VU+" model = "Duo" - arch = "mipsel" elif box == "solo2": manu = "VU+" model = "Solo2" - arch = "mipsel" elif box == "duo2": manu = "VU+" model = "Duo2" - arch = "mipsel" elif box == "uno": manu = "VU+" model = "Uno" - arch = "mipsel" elif box == "ultimo": manu = "VU+" model = "Ultimo" - arch = "mipsel" elif box == "tf7700hdpvr": manu = "Topfield" model = "HDPVR-7700" - arch = "sh4" elif box == "dm800": manu = "Dreambox" model = "800" - arch = "mipsel" elif box == "dm800se": manu = "Dreambox" model = "800se" - arch = "mipsel" elif box == "dm7080": manu = "Dreambox" model = "7080" - arch = "mipsel" elif box == "dm8000": manu = "Dreambox" model = "8000" - arch = "mipsel" elif box == "dm500hd": manu = "Dreambox" model = "500hd" - arch = "mipsel" elif box == "dm7025": manu = "Dreambox" model = "7025" - arch = "mipsel" elif box == "dm7020hd": manu = "Dreambox" model = "7020hd" - arch = "mipsel" elif box == "elite": manu = "Azbox" model = "Elite" - arch = "mipsel" elif box == "premium": manu = "Azbox" model = "Premium" - arch = "mipsel" elif box == "premium+": manu = "Azbox" model = "Premium+" - arch = "mipsel" elif box == "cuberevo-mini": manu = "Cubarevo" model = "Mini" - arch = "sh4" elif box == "hdbox": manu = "Fortis" model = "HdBox" - arch = "sh4" elif box == "gbquad": manu = "Gigablue" model = "Quad" - arch = "mipsel" elif box == "gbquadplus": manu = "Gigablue" model = "QuadPlus" - arch = "mipsel" elif box == "gb800seplus": manu = "Gigablue" model = "800SEPlus" - arch = "mipsel" elif box == "gb800ueplus": manu = "Gigablue" model = "800UEPlus" - arch = "mipsel" elif box == "et8000": manu = "Xtrend" model = "8000" - arch = "mipsel" elif box == "et10000": manu = "Xtrend" model = "10000" - arch = "mipsel" elif box == "maram9": manu = "Odin" model = "M9" - arch = "mipsel" else: printl2("Unknown box: " + str(box), "__common__::_setBoxtype", "D") - if arch == "mipsel": - oeVersion = getBoxArch() - else: - oeVersion = "duckbox" + # set arch for later processing + getBoxArch() + + # set oe version + getOeVersion() + + global g_boxData + g_boxData = (manu, model, g_archType, g_oeVersion) - boxData = (manu, model, arch, oeVersion) printl2("", "__common__::_setBoxtype", "C") - return boxData + +#=========================================================================== +# +#=========================================================================== +def getBoxArch(): + printl2("", "__common__::setBoxArch", "S") + + if g_archType is None: + setBoxArch() + + printl2("", "__common__::setBoxArch", "C") + return g_archType + +#=========================================================================== +# +#=========================================================================== +def setBoxArch(): + printl2("", "__common__::setBoxArch", "S") + + archType = "unknown" + + if (2, 6, 8) > sys.version_info > (2, 6, 6): + archType = "mipsel" + + elif (2, 7, 4) > sys.version_info > (2, 7, 0): + archType = "mips32el" + + global g_archType + g_archType = archType + + printl2("", "__common__::setBoxArch", "C") #=============================================================================== -# +# #=============================================================================== -def getBoxArch(): +def getOeVersion(): + printl2("", "__common__::getOeVersion", "S") + + if g_oeVersion is None: + setOeVersion() + + printl2("", "__common__::getOeVersion", "C") + return g_oeVersion + +#=============================================================================== +# +#=============================================================================== +def setOeVersion(): printl2("", "__common__::getBoxArch", "S") - ARCH = "unknown" + oeVersion = "unknown" if (2, 6, 8) > sys.version_info > (2, 6, 6): - ARCH = "oe16" + oeVersion = "oe16" if (2, 7, 4) > sys.version_info > (2, 7, 0): - ARCH = "oe20" + oeVersion = "oe20" + + # check for new oe2.2 + try: + from enigma import eMediaDatabase + oeVersion = "oe22" + except: + pass + + global g_oeVersion + g_oeVersion = oeVersion printl2("", "__common__::getBoxArch", "C") - return ARCH #=============================================================================== # diff --git a/src/plugin.py b/src/plugin.py index 30a13642..c3fb6e41 100755 --- a/src/plugin.py +++ b/src/plugin.py @@ -4,18 +4,23 @@ #=============================================================================== from Plugins.Plugin import PluginDescriptor -from Components.Network import iNetwork +try: + from Components.Network import iNetworkInfo +except: + from Components.Network import iNetwork + from Components.config import config, configfile from DP_Player import DP_Player from __init__ import prepareEnvironment, startEnvironment, _ # _ is translation -from __common__ import getUUID, saveLiveTv, getLiveTv +from __common__ import getUUID, saveLiveTv, getLiveTv, getOeVersion #=============================================================================== # GLOBALS #=============================================================================== HttpDeamonThread = None +HttpDeamonThreadConn = None HttpDeamonStarted = False global_session = None @@ -81,7 +86,13 @@ def startRemoteDeamon(): # we use the global g_mediaSyncerInfo.instance to take care only having one instance HttpDeamonThread = HttpDeamon() - HttpDeamonThread.PlayerDataPump.recv_msg.get().append(gotThreadMsg) + + if getOeVersion() != "oe22": + HttpDeamonThread.PlayerDataPump.recv_msg.get().append(gotThreadMsg) + else: + global HttpDeamonThreadConn + HttpDeamonThreadConn = HttpDeamonThread.PlayerDataPump.recv_msg.connect(gotThreadMsg) + runningWithoutErrors = HttpDeamonThread.startDeamon() if not runningWithoutErrors: @@ -142,11 +153,16 @@ def sessionStart(reason, **kwargs): # #=========================================================================== def networkStart(reason, **kwargs): + if reason is True and config.plugins.dreamplex.remoteAgent.value and HttpDeamonStarted: try: for adaptername in iNetwork.ifaces: - if iNetwork.ifaces[adaptername]['up'] is True: - HttpDeamonThread.setSession(global_session) + if getOeVersion() != "oe22": + if iNetwork.ifaces[adaptername]['up'] is True: + HttpDeamonThread.setSession(global_session) + else: + if iNetworkInfo.ifaces[adaptername]['up'] is True: + HttpDeamonThread.setSession(global_session) except Exception: pass