Skip to content

Commit

Permalink
made dreamplex dm7080 deb compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
DonDavici committed Nov 2, 2014
1 parent 99d93b2 commit a5ae540
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 139 deletions.
8 changes: 6 additions & 2 deletions src/DPH_StillPicture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

#===============================================================================
#
Expand Down Expand Up @@ -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")

Expand Down
27 changes: 21 additions & 6 deletions src/DP_Player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

#===============================================================================
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")
Expand All @@ -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()
Expand Down
17 changes: 13 additions & 4 deletions src/DP_Syncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

#===========================================================================
Expand Down Expand Up @@ -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":
Expand All @@ -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
Expand Down
130 changes: 66 additions & 64 deletions src/DP_SystemCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -47,7 +47,7 @@
#===============================================================================
class DPS_SystemCheck(Screen):

oeVersion = None
archVersion = None
check = None
latestVersion = None

Expand All @@ -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:
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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")

Expand All @@ -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
printl("", self, "C")
Loading

0 comments on commit a5ae540

Please sign in to comment.