Exemplo n.º 1
0
	def update_info(self):
		clients = ClientsStreaming("SHORT_ALL")
		clients2 = ClientsStreaming("INFO")
		text = clients.getText()
		text2 = clients2.getText()
		self["ScrollLabel"].setText(text or _("No clients streaming"))
		self["ScrollLabel2"].setText(text2 or _("No clients streaming"))
		self["key_blue"].setText(text and _("Stop Streams") or "")
		self.timer.startLongTimer(5)
Exemplo n.º 2
0
	def update_info(self):
		clients = ClientsStreaming("SHORT_ALL")
		clients2 = ClientsStreaming("EXTRA_INFO")
		#clients3 = ClientsStreaming("SHORT_ALL")
		text = clients.getText()
		text2 = clients2.getText()
		self["ScrollLabel"].setText(text or _("Currently nothing is streamed to clients"))
		self["ScrollLabel2"].setText(text2 or _("Currently nothing is streamed to clients"))
		self["key_blue"].setText(text and _("Stop Streams") or "")
		self.timer.startLongTimer(5)
Exemplo n.º 3
0
	def __init__(self, session, menu_path = ""):
		Screen.__init__(self, session)
		screentitle = _("Streaming clients info")
		menu_path += screentitle
		if config.usage.show_menupath.value == 'large':
			title = menu_path
			self["menu_path_compressed"] = StaticText("")
		elif config.usage.show_menupath.value == 'small':
			title = screentitle
			self["menu_path_compressed"] = StaticText(menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "")
		else:
			title = screentitle
			self["menu_path_compressed"] = StaticText("")
		Screen.setTitle(self, title)
		clients = ClientsStreaming("INFO_RESOLVE")
		text = clients.getText()

		self["ScrollLabel"] = ScrollLabel(text or _("No stream clients"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
		{
			"cancel": self.close,
			"ok": self.close,
			"up": self["ScrollLabel"].pageUp,
			"down": self["ScrollLabel"].pageDown
		})
    def __init__(self, session, menu_path=""):
        Screen.__init__(self, session)
        screentitle = _("Streaming clients info")
        menu_path += screentitle
        if config.usage.show_menupath.value == 'large':
            title = menu_path
            self["menu_path_compressed"] = StaticText("")
        elif config.usage.show_menupath.value == 'small':
            title = screentitle
            self["menu_path_compressed"] = StaticText(
                menu_path +
                " >" if not menu_path.endswith(' / ') else menu_path[:-3] +
                " >" or "")
        else:
            title = screentitle
            self["menu_path_compressed"] = StaticText("")
        Screen.setTitle(self, title)
        clients = ClientsStreaming("INFO_RESOLVE")
        text = clients.getText()

        self["ScrollLabel"] = ScrollLabel(text or _("No stream clients"))

        self["key_red"] = Button(_("Close"))
        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "red": self.close,
                "up": self["ScrollLabel"].pageUp,
                "down": self["ScrollLabel"].pageDown
            })
Exemplo n.º 5
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("Streaming clients info"))

		if ClientsStreaming("NUMBER").getText() == "0":
			self["total"] = StaticText( _("No stream clients") )
			text = ""
		else:
			self["total"] = StaticText( _("Total Clients streaming: ") + ClientsStreaming("NUMBER").getText())
			text = ClientsStreaming("EXTRA_INFO").getText()
			clients = ClientsStreaming("INFO_RESOLVE")
			text = clients.getText()

		self["liste"] = StaticText(text)
		self["ScrollLabel"] = ScrollLabel(text)

		self["key_red"] = Button(_("Close"))
		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"red": self.close,
				"up": self["ScrollLabel"].pageUp,
				"down": self["ScrollLabel"].pageDown
			})
Exemplo n.º 6
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("Streaming clients info"))

        if ClientsStreaming("NUMBER").getText() == "0":
            self["total"] = StaticText(_("No stream clients"))
            text = ""
        else:
            self["total"] = StaticText(
                _("Total Clients streaming: ") +
                ClientsStreaming("NUMBER").getText())
            text = ClientsStreaming("EXTRA_INFO").getText()
            clients = ClientsStreaming("INFO_RESOLVE")
            text = clients.getText()

        self["liste"] = StaticText(text)
        self["ScrollLabel"] = ScrollLabel(text)

        self["key_red"] = Button(_("Close"))
        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "red": self.close,
                "up": self["ScrollLabel"].pageUp,
                "down": self["ScrollLabel"].pageDown
            })
Exemplo n.º 7
0
    def update_info(self):
        self.clients = []
        if self.streamServer:
            for x in self.streamServer.getConnectedClients():
                service_name = ServiceReference(
                    x[1]).getServiceName() or "(unknown service)"
                ip = x[0]
                if int(x[2]) == 0:
                    strtype = "S"
                else:
                    strtype = "T"
                try:
                    raw = socket.gethostbyaddr(ip)
                    ip = raw[0]
                except:
                    pass
                info = ("%s %-8s %s") % (strtype, ip, service_name)
                self.clients.append((info, (x[0], x[1])))
        if StreamServiceList and streamList:
            for x in StreamServiceList:
                ip = "ip n/a"
                service_name = "(unknown service)"
                for stream in streamList:
                    if hasattr(stream, 'getService') and stream.getService(
                    ) and stream.getService().__deref__() == x:
                        service_name = ServiceReference(
                            stream.ref.toString()).getServiceName()
                        ip = stream.clientIP or ip
            info = ("T %s %s") % (ip, service_name)
            self.clients.append((info, (-1, x)))

        self["total"].setText(
            _("Total Clients streaming: ") +
            str(ClientsStreaming("NUMBER").getText()))
        myclients = ClientsStreaming("EXTRA_INFO")
        text = myclients.getText()

        clients = ClientsStreaming("INFO_RESOLVE")
        text = clients.getText()
        self["menu"].setList(self.clients)
        if self.clients:
            self["info"].setText("")
            self["key_blue"].setText(text and _("Stop Streams") or "")
        else:
            self["info"].setText(text or _("No stream clients"))
        self.DynamicTimer.start(4000)
Exemplo n.º 8
0
 def doPowerOffRun(self):
     if self.session:
         if self.wait_nextday:
             if time() >= self.nextday_time:
                 print "[PowerOffTimer] Cancel waiting shutdown, over limit, set next day."
                 self.powerStateTimerChanged()
                 return
         try_poweroff = True
         if isExternalToolsRunning():
             try_poweroff = False
         if RecordTimerEntry.wasInDeepStandby:
             try_poweroff = False
         if try_poweroff:
             if not self.session.nav.getRecordings():
                 rec_time = self.session.nav.RecordTimer.getNextRecordingTime(
                 )
                 if rec_time > 0 and (rec_time - time()) < 360:
                     try_poweroff = False
             else:
                 try_poweroff = False
         if try_poweroff:
             jobs = len(job_manager.getPendingJobs())
             if Standby.inStandby is None:
                 if not config.usage.poweroff_force.value:
                     try_poweroff = False
             elif jobs or self.session.screen[
                     "TunerInfo"].tuner_use_mask or internalHDDNotSleeping(
                     ):
                 try_poweroff = False
         if try_poweroff:
             if Standby.inStandby is None:
                 reason = _("Power off timer") + '\n\n'
                 if jobs:
                     if jobs == 1:
                         job = job_manager.getPendingJobs()[0]
                         reason += "%s: %s (%d%%)\n" % (
                             job.getStatustext(), job.name,
                             int(100 * job.progress / float(job.end)))
                     else:
                         reason += (ngettext(
                             "%d job is running in the background!",
                             "%d jobs are running in the background!", jobs)
                                    % jobs) + '\n'
                 if self.session.nav.getClientsStreaming():
                     clients = ClientsStreaming("SHORT_ALL")
                     reason += clients.getText() + '\n'
                 self.session.openWithCallback(self.doPowerOffAnswer,
                                               MessageBox,
                                               reason +
                                               _("Really shutdown now?"),
                                               type=MessageBox.TYPE_YESNO,
                                               timeout=180)
             else:
                 self.doPowerOffAnswer(True)
         else:
             print "[PowerOffTimer] Don't shutdown, box in use. Wait 5 min..."
             self.doPowerOffTimer.start(self.wait_nextday_time * 1000, True)
             self.wait_nextday = True
Exemplo n.º 9
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("Streaming clients info"))
		clients = ClientsStreaming("INFO_RESOLVE")
		text = clients.getText()

		self["ScrollLabel"] = ScrollLabel(text or _("No stream clients"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
		{
			"cancel": self.close,
			"ok": self.close,
			"up": self["ScrollLabel"].pageUp,
			"down": self["ScrollLabel"].pageDown
		})
Exemplo n.º 10
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("Streaming clients info"))
        clients = ClientsStreaming("INFO_RESOLVE")
        text = clients.getText()

        self["ScrollLabel"] = ScrollLabel(text)

        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "up": self["ScrollLabel"].pageUp,
                "down": self["ScrollLabel"].pageDown
            })
Exemplo n.º 11
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("Streaming clients info"))

        clients = ClientsStreaming("INFO_RESOLVE")
        text = clients.getText()

        self["ScrollLabel"] = ScrollLabel(text or _("No stream clients"))
        self["key_red"] = Button(text and _("Stop Streams") or "")

        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "red": self.stopStreams,
                "up": self["ScrollLabel"].pageUp,
                "down": self["ScrollLabel"].pageDown
            })
Exemplo n.º 12
0
 def update_info(self):
     clients = ClientsStreaming('INFO_RESOLVE')
     text = clients.getText()
     self['ScrollLabel'].setText(text or _('No clients streaming'))
     self['key_blue'].setText(text and _('Stop Streams') or '')
     self.timer.startLongTimer(5)
Exemplo n.º 13
0
	def update_info(self):
		clients = ClientsStreaming("INFO_RESOLVE")
		text = clients.getText()
		self["ScrollLabel"].setText(text or _("No clients streaming"))
		self["key_blue"].setText(text and _("Stop Streams") or "")
		self.timer.startLongTimer(5)