Example #1
0
	def leavePlayerConfirmed(self, answer):
		printl("", self, "S")

		if answer != "EOF":
			self.handleProgress()

		else:
			self.handleProgress(EOF=True)

		if self.playbackType == "1":
			self.stopTranscoding()

		if config.plugins.dreamplex.lcd4linux.value:
			remove(self.tempPoster)

		# we destroy here all variables to be sure that they are away
		if self.timelineWatcher is not None:
			if getOeVersion() != "oe22":
				self.timelineWatcher.stop()
			else:
				self.timelineWatcherConn = None

		# we stop playback here
		self.session.nav.stopService()

		# if self.startedByRemotePlayer:
		# 	self.session.nav.playService(getLiveTv())

		self.close((False, ))

		printl("", self, "C")
Example #2
0
    def installPyhtonTextutilsLibs(self, confirm):
        printl("", self, "S")

        command = ""

        if confirm:
            # User said 'Yes'

            if self.archVersion == "mipsel":
                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")

            self.executeInstallationCommand(command)

        else:
            # User said 'no'
            self.cancel()

        printl("", self, "C")
Example #3
0
	def installPackage(self, confirm):
		printl("", self, "S")

		command = ""

		if confirm:
			# User said 'Yes'

			if self.archVersion == "mipsel":
				command = "opkg update; opkg install " + str(self.package)

			elif self.archVersion == "mips32el":
				if getOeVersion() != "oe22":
					command = "opkg update; opkg install " + str(self.package)
				else:
					command = "apt-get update && apt-get install " + str(self.package) + " --force-yes -y"

			else:
				printl("something went wrong finding out the oe-version", self, "W")

			self.executeInstallationCommand(command)
		else:
			# User said 'no'
			self.cancel()

		printl("", self, "C")
Example #4
0
    def startSyncing(self):
        printl("", self, "S")

        if not self.running:
            self.backgroundMediaSyncer = BackgroundMediaSyncer()
            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":
                self.backgroundMediaSyncer.setServerConfig(self.serverConfig)
                self.backgroundMediaSyncer.setPlexInstance(self.plexInstance)

            self.backgroundMediaSyncer.startSyncing()
            self.running = True

        printl("", self, "C")
Example #5
0
    def installStreamingLibs(self, confirm):
        printl("", self, "S")

        command = ""

        if confirm:
            # User said 'Yes'

            if self.archVersion == "mipsel":
                command = "opkg update; opkg install gst-plugin-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")

            self.executeInstallationCommand(command)

        else:
            # User said 'no'
            self.cancel()

        printl("", self, "C")
Example #6
0
    def updateToLatestVersion(self):
        printl("", self, "S")

        if config.plugins.dreamplex.updateType.value == "1":
            updateType = "Stable"
        else:
            updateType = "Beta"

        if getOeVersion() != "oe22":
            remoteUrl = "http://sourceforge.net/projects/dreamplex/files/" + str(
                updateType
            ) + "/ipk/enigma2-plugin-extensions-dreamplex_" + str(
                self.latestVersion) + "_all.ipk/download"
            cmd = "curl -o /tmp/temp.ipk -L -k " + str(
                remoteUrl
            ) + " && opkg install --force-overwrite --force-depends /tmp/temp.ipk; rm /tmp/temp.ipk"
            #bintray runing => cmd = "curl -o /tmp/temp.ipk -L -k https://bintray.com/artifact/download/dondavici/Dreambox/enigma2-plugin-extensions-dreamplex_" + str(self.latestVersion) + "_all.ipk && opkg install --force-overwrite --force-depends /tmp/temp.ipk; rm /tmp/temp.ipk"

        else:
            remoteUrl = "http://sourceforge.net/projects/dreamplex/files/" + str(
                updateType
            ) + "/deb/enigma2-plugin-extensions-dreamplex_" + str(
                self.latestVersion) + "_all.deb/download"
            cmd = "curl -o /tmp/temp.deb -L -k " + str(
                remoteUrl
            ) + " && dpkg -i /tmp/temp.deb; apt-get update && apt-get -f install; rm /tmp/temp.deb"
            #bintray runing => cmd = "curl -o /tmp/temp.deb -L -k https://bintray.com/artifact/download/dondavici/Dreambox/enigma2-plugin-extensions-dreamplex_" + str(self.latestVersion) + "_all.deb && dpkg -i /tmp/temp.deb; rm /tmp/temp.deb"

        printl("cmd: " + str(cmd), self, "D")

        self.session.open(SConsole, "Excecuting command:", [cmd],
                          self.finishupdate)

        printl("", self, "C")
Example #7
0
def updateNotifier():
	if notifyWatcher is not None:
		players = getPlayer()
		if not players:
			if getOeVersion() != "oe22":
				notifyWatcher.stop()
			else:
				global notifyWatcherConn
				notifyWatcherConn = None
Example #8
0
def updateNotifier():
    if notifyWatcher is not None:
        players = getPlayer()
        if not players:
            if getOeVersion() != "oe22":
                notifyWatcher.stop()
            else:
                global notifyWatcherConn
                notifyWatcherConn = None
Example #9
0
	def startSubtitleWatcher(self):
		printl("", self, "S")

		self.subtitleWatcher = eTimer()

		if getOeVersion() != "oe22":
			self.subtitleWatcher.callback.append(self.subtitleChecker)
		else:
			self.subtitleWatcherConn = self.subtitleWatcher.timeout.connect(self.subtitleChecker)

		printl("", self, "C")
Example #10
0
	def checkInstallationState(self, override=False):
		printl("", self, "S")

		if getOeVersion() != "oe22":
			command = "opkg status " + str(self.package)
		else:
			command = "dpkg -s " + str(self.package)

		state = self.executeStateCheck(command, override)

		printl("", self, "C")
		return state
Example #11
0
def startNotifier():
	global notifyWatcher

	notifyWatcher = eTimer()

	if getOeVersion() != "oe22":
		notifyWatcher.callback.append(notifySubscribers)
	else:
		global notifyWatcherConn
		notifyWatcherConn = notifyWatcher.timeout.connect(notifySubscribers)

	notifyWatcher.start(1000,False)
Example #12
0
    def checkInstallationState(self, override=False):
        printl("", self, "S")

        if getOeVersion() != "oe22":
            command = "opkg status " + str(self.package)
        else:
            command = "dpkg -s " + str(self.package)

        state = self.executeStateCheck(command, override)

        printl("", self, "C")
        return state
Example #13
0
def startNotifier():
    global notifyWatcher

    notifyWatcher = eTimer()

    if getOeVersion() != "oe22":
        notifyWatcher.callback.append(notifySubscribers)
    else:
        global notifyWatcherConn
        notifyWatcherConn = notifyWatcher.timeout.connect(notifySubscribers)

    notifyWatcher.start(1000, False)
Example #14
0
    def checkPythonTextutils(self):
        printl("", self, "S")

        if getOeVersion() != "oe22":
            command = "opkg status python-textutils"
        else:
            command = "dpkg -s python-textutils"

        self.check = "pythonTextutils"
        state = self.executeCommand(command)

        printl("", self, "C")
        return state
Example #15
0
    def checkPythonImagingInstallation(self):
        printl("", self, "S")

        if getOeVersion() != "oe22":
            command = "opkg status python-imaging"
        else:
            command = "dpkg -s python-imaging"

        self.check = "pythonImaging"
        state = self.executeCommand(command)

        printl("", self, "C")
        return state
Example #16
0
    def checkJpegToolsInstallation(self):
        printl("", self, "S")

        if getOeVersion() != "oe22":
            command = "opkg status mjpegtools"
        else:
            command = "dpkg -s mjpegtools"

        self.check = "jpegTools"
        state = self.executeCommand(command)

        printl("", self, "C")
        return state
Example #17
0
    def checkOpensslInstallation(self, override=False):
        printl("", self, "S")

        if getOeVersion() != "oe22":
            command = "opkg status python-pyopenssl"
        else:
            command = "dpkg -s python-pyopenssl"

        self.check = "openssl"
        state = self.executeCommand(command, override)

        printl("", self, "C")
        return state
Example #18
0
	def startTimelineWatcher(self):
		printl("", self, "S")

		self.timelineWatcher = eTimer()

		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")
			self.multiUser = True

		printl("", self, "C")
Example #19
0
    def __init__(self, session):
        printl("", self, "S")

        Renderer.__init__(self)

        self.showiframe = Showiframe()
        self.session = session
        self.poll_timer = eTimer()

        if getOeVersion() != "oe22":
            self.poll_timer.callback.append(self.poll)
        else:
            self.poll_timerConn = self.poll_timer.timeout.connect(self.poll)

        printl("", self, "C")
Example #20
0
	def __init__(self, session):
		printl("", self , "S")

		Renderer.__init__(self)

		self.showiframe = Showiframe()
		self.session = session
		self.poll_timer = eTimer()

		if getOeVersion() != "oe22":
			self.poll_timer.callback.append(self.poll)
		else:
			self.poll_timerConn = self.poll_timer.timeout.connect(self.poll)

		printl("", self, "C")
Example #21
0
    def installOpensslLibs(self, confirm):
        printl("", self, "S")

        command = ""

        if confirm:
            # User said 'Yes'

            if self.archVersion == "mipsel":
                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")

            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()
        else:
            # User said 'no'
            self.cancel()

        printl("", self, "C")
Example #22
0
def startRemoteDeamon():
	from DPH_RemoteListener import HttpDeamon
	global HttpDeamonThread
	global HttpDeamonStarted

	HttpDeamonThread = HttpDeamon()

	if getOeVersion() != "oe22":
		HttpDeamonThread.PlayerDataPump.recv_msg.get().append(gotThreadMsg)
	else:
		global HttpDeamonThreadConn
		HttpDeamonThreadConn = HttpDeamonThread.PlayerDataPump.recv_msg.connect(gotThreadMsg)

	HttpDeamonThread.prepareDeamon() # we just prepare. we are starting only on networkStart with HttpDeamonThread.setSession
	HttpDeamonStarted = HttpDeamonThread.getDeamonState()[1]

	if HttpDeamonStarted:
		HttpDeamonThread.setSession(global_session)
Example #23
0
	def gotThreadMsg(self, msg):
		printl("", self, "S")

		msg = self.backgroundMediaSyncer.Message.pop()
		self.infoCallBack(msg[1])

		if msg[0] == THREAD_FINISHED:
			# clean up
			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
			self.done()

		printl("", self, "C")
Example #24
0
def startRemoteDeamon():
    from DPH_RemoteListener import HttpDeamon

    global HttpDeamonThread
    global HttpDeamonStarted

    HttpDeamonThread = HttpDeamon()

    if getOeVersion() != "oe22":
        HttpDeamonThread.PlayerDataPump.recv_msg.get().append(gotThreadMsg)
    else:
        global HttpDeamonThreadConn
        HttpDeamonThreadConn = HttpDeamonThread.PlayerDataPump.recv_msg.connect(gotThreadMsg)

    HttpDeamonThread.prepareDeamon()  # we just prepare. we are starting only on networkStart with HttpDeamonThread.setSession
    HttpDeamonStarted = HttpDeamonThread.getDeamonState()[1]

    if HttpDeamonStarted:
        HttpDeamonThread.setSession(global_session)
Example #25
0
	def gotThreadMsg(self, msg):
		printl("", self, "S")

		msg = self.backgroundMediaSyncer.Message.pop()
		self.infoCallBack(msg[1])

		if msg[0] == THREAD_FINISHED:
			# clean up
			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
			self.done()

		printl("", self, "C")
Example #26
0
	def pauseService(self):
		printl("", self, "S")

		if self.playbackType == "1"  and self.universalTranscoder:
			self.transcoderHeartbeat = eTimer()

			if getOeVersion() != "oe22":
				self.transcoderHeartbeat.callback.append(self.keepTranscoderAlive)
			else:
				self.transcoderHeartbeatConn = self.transcoderHeartbeat.timeout.connect(self.keepTranscoderAlive)

			self.transcoderHeartbeat.start(10000,False)

		if self.timelineWatcher is not None:
			self.timelineWatcher.stop()

		super(DP_Player,self).pauseService()

		printl("", self, "C")
Example #27
0
    def updateToLatestVersion(self):
        printl("", self, "S")

        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")

        self.session.open(SConsole, "Excecuting command:", [cmd],
                          self.finishupdate)

        printl("", self, "C")
Example #28
0
	def startSyncing(self):
		printl("", self, "S")

		if not self.running:
			self.backgroundMediaSyncer = BackgroundMediaSyncer()
			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":
				self.backgroundMediaSyncer.setServerConfig(self.serverConfig)
				self.backgroundMediaSyncer.setPlexInstance(self.plexInstance)

			self.backgroundMediaSyncer.startSyncing()
			self.running = True

		printl("", self, "C")
Example #29
0
	def setPoster(self):
		"""
		set params for poster via ePicLoad object
		"""
		printl("", self, "S")

		self.EXscale = (AVSwitch().getFramebufferScale())

		self.EXpicloadPoster.setPara([self["poster"].instance.size().width(), self["poster"].instance.size().height(), self.EXscale[0], self.EXscale[1], 0, 1, "#002C2C39"])

		if self.whatPoster is None:
			self.buildPosterData()

		if getOeVersion() != "oe22":
			self.EXpicloadPoster.startDecode(self.whatPoster,0,0,False)
		else:
			self.EXpicloadPoster.startDecode(self.whatPoster,False)

		self.ptr = self.EXpicloadPoster.getData()

		self.renderPoster()

		printl("", self, "C")
Example #30
0
	def updateToLatestVersion(self):
		printl("", self, "S")

		if config.plugins.dreamplex.updateType.value == "1":
			updateType = "Stable"
		else:
			updateType = "Beta"

		if getOeVersion() != "oe22":
			remoteUrl = "http://sourceforge.net/projects/dreamplex/files/" + str(updateType) + "/ipk/enigma2-plugin-extensions-dreamplex_" + str(self.latestVersion) + "_all.ipk/download"
			cmd = "curl -o /tmp/temp.ipk -L -k " + str(remoteUrl) + " && opkg install --force-overwrite --force-depends /tmp/temp.ipk; rm /tmp/temp.ipk"
			#bintray runing => cmd = "curl -o /tmp/temp.ipk -L -k https://bintray.com/artifact/download/dondavici/Dreambox/enigma2-plugin-extensions-dreamplex_" + str(self.latestVersion) + "_all.ipk && opkg install --force-overwrite --force-depends /tmp/temp.ipk; rm /tmp/temp.ipk"

		else:
			remoteUrl = "http://sourceforge.net/projects/dreamplex/files/" + str(updateType) + "/deb/enigma2-plugin-extensions-dreamplex_" + str(self.latestVersion) + "_all.deb/download"
			cmd = "curl -o /tmp/temp.deb -L -k " + str(remoteUrl) + " && dpkg -i /tmp/temp.deb; apt-get update && apt-get -f install; rm /tmp/temp.deb"
			#bintray runing => cmd = "curl -o /tmp/temp.deb -L -k https://bintray.com/artifact/download/dondavici/Dreambox/enigma2-plugin-extensions-dreamplex_" + str(self.latestVersion) + "_all.deb && dpkg -i /tmp/temp.deb; rm /tmp/temp.deb"

		printl("cmd: " + str(cmd), self, "D")

		self.session.open(SConsole,"Excecuting command:", [cmd] , self.finishupdate)

		printl("", self, "C")
Example #31
0
    def checkLib(self, arch):
        printl("", self, "S")

        command = None

        if arch == "oe16":
            command = "opkg status gst-plugin-fragmented"
            self.archVersion = "mipsel"

        elif arch == "oe20":
            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")

        self.check = "gst"
        self.executeCommand(command)

        printl("", self, "C")