Esempio n. 1
0
	def __init__(self, session, args = None):
		Screen.__init__(self, session)

		self.temp_timer = eTimer()
		self.temp_timer.callback.append(self.updateTemp)

		for count in range(8):
			self["ProTemp%d" % count] = Progress()
			self["TxtTemp%d" % count] = StaticText("")
		self["ProHDD"] = Progress()
		self["TxtHDD"] = StaticText("")
		self["ProFan"] = Progress()
		self["TxtFan"] = StaticText("")
		self["TxtFC2Temp"] = StaticText("")
		self["TxtMinTemp"] = Label("30")
		self["TxtMaxTemp"] = Label("55")

		self["actions"] = ActionMap(["OkCancelActions", "EPGSelectActions"],
		{
			"ok": self.cancel,
			"cancel": self.cancel,
			"info": self.getHDD
		}, -1)

		self.onLayoutFinish.append(self.updateTemp)
Esempio n. 2
0
	def __init__(self, session, url, folder, filename):
		screen = """
		  <screen  flags="wfNoBorder" position="0,0" size="1280,720" backgroundColor="transparent">
		  <widget source="fname" render="Label" position="610,147" size="580,75" font="Regular;18" halign="center" valign="center"  transparent="1" />
		  <widget source="progressbar" render="Progress" pixmap="icons/bar_downloader.png" position="610,233" size="580,12" zPosition="2" transparent="1" />
		  <widget source="status" render="Label" position="610,258" zPosition="3" size="580,71" font="Regular;22" halign="center" transparent="1" />
		</screen>"""
		Screen.__init__(self, session)
		self.url = url
		self.filename = filename
		self.dstfilename = folder + filename
		self["oktext"] = Label(_("OK"))
		self["canceltext"] = Label(_("Cancel"))
		self["fname"] = StaticText('')
		self["status"] = StaticText('')
		self["progressbar"] = Progress()
		self["progressbar"].range = 1000
		self["progressbar"].value = 0
		self["actions"] = ActionMap(["WizardActions", "DirectionActions",'ColorActions'], 
		{
			"ok": self.cancel,
			"back": self.cancel,
			"red": self.stop,
			"green": self.cancel
		}, -1)
		self.autoCloseTimer = eTimer()
		self.autoCloseTimer.timeout.get().append(self.cancel)
		self.startDownloadTimer = eTimer()
		self.startDownloadTimer.timeout.get().append(self.fileDownload)
		self.download = None
		self.downloading(False)
		self.onShown.append(self.setWindowTitle)
		self.onLayoutFinish.append(self.startDownload)
Esempio n. 3
0
 def __init__(self,
              session,
              title=_('Command execution...'),
              cmdlist=[],
              cmdmax=None,
              finishedCallback=None,
              closeOnSuccess=False,
              progressmode=True):
     Screen.__init__(self, session)
     self.finishedCallback = finishedCallback
     self.closeOnSuccess = closeOnSuccess
     self.cmdmax = cmdmax or len(cmdlist)
     self.progressmode = progressmode
     self.slider = Progress(0, 1000)
     self['slider'] = self.slider
     self.activityslider = Progress(0, 1000)
     self['activityslider'] = self.activityslider
     self.status = StaticText('')
     self['status'] = self.status
     self.text = StaticText('')
     self['text'] = self.text
     self.helpinfo = StaticText('')
     self['helpinfo'] = self.helpinfo
     self.activity = 0
     self.activityTimer = eTimer()
     self.activityTimer.callback.append(self.doActivityTimer)
     self.console = StaticText(None)
     self['console'] = self.console
     self.consolestatus = StaticText(None)
     self['consolestatus'] = self.consolestatus
     self['actions'] = ActionMap(
         ['WizardActions', 'DirectionActions', 'TimerEditActions'], {
             'ok': self.ok,
             'back': self.cancel,
             'up': self.up,
             'down': self.down,
             'left': self.left,
             'right': self.right,
             'log': self.swapMode
         }, -1)
     size = getDesktop(0).size()
     self.fullsize = eSize(size.width() - 100, size.height() - 100)
     self.fullpos = ePoint(50, 50)
     self.cmdlist = cmdlist
     self.newtitle = title
     self.block = False
     self.text_long = ''
     self.stat_long = ''
     self.ret = 0
     self.run = 0
     self.container = eConsoleAppContainer()
     self.container.appClosed.append(self.runFinished)
     self.container.dataAvail.append(self.dataAvail)
     self.flagexit = False
     self.animation = False
     self.animationstep = 1 if HardwareInfo().get_device_model(
     ) == 'dm8000' else 15
     self.onClose.append(self._onClose)
     self.onLayoutFinish.append(self._onLayoutFinish)
     return
Esempio n. 4
0
 def __init__(self, session, url, folder, filename):
     Screen.__init__(self, session)
     self.url = url
     self.filename = filename
     self.dstfilename = folder + filename
     self['oktext'] = Label(_('OK'))
     self['canceltext'] = Label(_('Cancel'))
     self['fname'] = StaticText('')
     self['status'] = StaticText('')
     self['progressbar'] = Progress()
     self['progressbar'].range = 1000
     self['progressbar'].value = 0
     self['actions'] = ActionMap(
         ['WizardActions', 'DirectionActions', 'ColorActions'], {
             'ok': self.cancel,
             'back': self.cancel,
             'red': self.stop,
             'green': self.cancel
         }, -1)
     self.last_recvbytes = 0
     self.autoCloseTimer = eTimer()
     self.autoCloseTimer.timeout.get().append(self.cancel)
     self.startDownloadTimer = eTimer()
     self.startDownloadTimer.timeout.get().append(self.fileDownload)
     self.download = None
     self.downloading(False)
     self.onShown.append(self.setWindowTitle)
     self.onLayoutFinish.append(self.startDownload)
     return
Esempio n. 5
0
 def __init__(self, session, url, folder, filename):
     Screen.__init__(self, session)
     self.url = url
     self.filename = filename
     self.dstfilename = folder + filename
     self['oktext'] = Label(_('OK'))
     self['canceltext'] = Label(_('Cancel'))
     self['fname'] = StaticText('')
     self['status'] = StaticText('')
     self['progressbar'] = Progress()
     self['progressbar'].range = 1000
     self['progressbar'].value = 0
     self['actions'] = ActionMap(['WizardActions', 'DirectionActions', 'ColorActions'], {'ok': self.cancel,
      'back': self.cancel,
      'red': self.stop,
      'green': self.cancel}, -1)
     self.autoCloseTimer = eTimer()
     self.autoCloseTimer.timeout.get().append(self.cancel)
     self.startDownloadTimer = eTimer()
     self.startDownloadTimer.timeout.get().append(self.fileDownload)
     self.download = None
     self.downloading(False)
     self.onShown.append(self.setWindowTitle)
     self.onLayoutFinish.append(self.startDownload)
     return
Esempio n. 6
0
    def __init__(self,
                 session,
                 job,
                 parent=None,
                 cancelable=True,
                 backgroundable=True,
                 afterEventChangeable=True):
        from Components.Sources.StaticText import StaticText
        from Components.Sources.Progress import Progress
        from Components.Sources.Boolean import Boolean
        from Components.ActionMap import ActionMap
        Screen.__init__(self, session, parent)
        InfoBarNotifications.__init__(self)
        ConfigListScreen.__init__(self, [])
        self.parent = parent
        self.job = job
        self.setTitle(_("Job overview"))

        self["job_name"] = StaticText(job.name)
        self["job_progress"] = Progress()
        self["job_task"] = StaticText()
        self["summary_job_name"] = StaticText(job.name)
        self["summary_job_progress"] = Progress()
        self["summary_job_task"] = StaticText()
        self["job_status"] = StaticText()
        self["finished"] = Boolean()
        self["cancelable"] = Boolean(cancelable)
        self["backgroundable"] = Boolean(backgroundable)

        self["key_blue"] = StaticText(_("Background"))

        self.onShow.append(self.windowShow)
        self.onHide.append(self.windowHide)

        self["setupActions"] = ActionMap(
            ["ColorActions", "SetupActions"], {
                "green": self.ok,
                "red": self.abort,
                "blue": self.background,
                "cancel": self.ok,
                "ok": self.ok,
            }, -2)

        self.settings = ConfigSubsection()
        if SystemInfo["DeepstandbySupport"]:
            shutdownString = _("go to deep standby")
        else:
            shutdownString = _("shut down")
        self.settings.afterEvent = ConfigSelection(choices=[
            ("nothing", _("do nothing")), ("close", _("Close")),
            ("standby", _("go to standby")), ("deepstandby", shutdownString)
        ],
                                                   default=self.job.afterEvent
                                                   or "nothing")
        self.job.afterEvent = self.settings.afterEvent.getValue()
        self.afterEventChangeable = afterEventChangeable
        self.setupList()
        self.state_changed()
Esempio n. 7
0
 def __init__(self,
              session,
              job,
              parent=None,
              cancelable=True,
              backgroundable=True,
              afterEventChangeable=True,
              afterEvent='nothing'):
     from Components.Sources.StaticText import StaticText
     from Components.Sources.Progress import Progress
     from Components.Sources.Boolean import Boolean
     from Components.ActionMap import ActionMap
     Screen.__init__(self, session, parent)
     Screen.setTitle(self, _('Job View'))
     InfoBarNotifications.__init__(self)
     ConfigListScreen.__init__(self, [])
     self.parent = parent
     self.job = job
     if afterEvent:
         self.job.afterEvent = afterEvent
     self['job_name'] = StaticText(job.name)
     self['job_progress'] = Progress()
     self['job_task'] = StaticText()
     self['summary_job_name'] = StaticText(job.name)
     self['summary_job_progress'] = Progress()
     self['summary_job_task'] = StaticText()
     self['job_status'] = StaticText()
     self['finished'] = Boolean()
     self['cancelable'] = Boolean(cancelable)
     self['backgroundable'] = Boolean(backgroundable)
     self['key_blue'] = StaticText(_('Background'))
     self.onShow.append(self.windowShow)
     self.onHide.append(self.windowHide)
     self['setupActions'] = ActionMap(
         ['ColorActions', 'SetupActions'], {
             'green': self.ok,
             'red': self.abort,
             'blue': self.background,
             'cancel': self.ok,
             'ok': self.ok
         }, -2)
     self.settings = ConfigSubsection()
     if SystemInfo['DeepstandbySupport']:
         shutdownString = _('go to deep standby')
     else:
         shutdownString = _('shut down')
     self.settings.afterEvent = ConfigSelection(choices=[
         ('nothing', _('do nothing')), ('close', _('Close')),
         ('standby', _('go to standby')), ('deepstandby', shutdownString)
     ],
                                                default=self.job.afterEvent
                                                or 'nothing')
     self.job.afterEvent = self.settings.afterEvent.value
     self.afterEventChangeable = afterEventChangeable
     self.setupList()
     self.state_changed()
Esempio n. 8
0
    def __init__(self,
                 session,
                 feid,
                 test_type=TEST_TYPE_QUICK,
                 loopsfailed=3,
                 loopssuccessful=1,
                 log=False):
        Screen.__init__(self, session)
        self.setup_title = _("DiSEqC Tester")
        self.feid = feid
        self.test_type = test_type
        self.loopsfailed = loopsfailed
        self.loopssuccessful = loopssuccessful
        self.log = log
        self["Overall_progress"] = Label(_("Overall progress:"))
        self["Progress"] = Label(_("Progress:"))
        self["Failed"] = Label(_("Failed:"))
        self["Succeeded"] = Label(_("Succeeded:"))
        self["Not_tested"] = Label(_("Not tested:"))
        self["With_errors"] = Label(_("With errors:"))
        self["actions"] = NumberActionMap(["SetupActions"], {
            "ok": self.select,
            "cancel": self.keyCancel,
        }, -2)

        TuneTest.__init__(self,
                          feid,
                          stopOnSuccess=self.loopssuccessful,
                          stopOnError=self.loopsfailed)
        self["Frontend"] = FrontendStatus(
            frontend_source=lambda: self.frontend, update_interval=100)
        self["overall_progress"] = Progress()
        self["sub_progress"] = Progress()

        self["failed_counter"] = StaticText("0")
        self["succeeded_counter"] = StaticText("0")
        self["witherrors_counter"] = StaticText("0")
        self["untestable_counter"] = StaticText("0")

        self.list = []
        self["progress_list"] = List(self.list)
        self["progress_list"].onSelectionChanged.append(self.selectionChanged)

        self["CmdText"] = StaticText(
            _("Please wait while scanning is in progress..."))

        self.indexlist = {}
        self.readTransponderList()

        self.running = False

        self.results = {}
        self.resultsstatus = {}

        self.onLayoutFinish.append(self.go)
	def __init__(self, session, job, parent=None, cancelable=True, backgroundable=True, afterEventChangeable=True):
		Screen.__init__(self, session, parent)
		InfoBarNotifications.__init__(self)
		ConfigListScreen.__init__(self, [])
		self.parent = parent
		self.job = job
		self.setTitle(_("Job overview"))

		self["job_name"] = StaticText(job.name)
		self["job_progress"] = Progress()
		self["job_task"] = StaticText()
		self["summary_job_name"] = StaticText(job.name)
		self["summary_job_progress"] = Progress()
		self["summary_job_task"] = StaticText()
		self["job_status"] = StaticText()

		self.cancelable = cancelable
		self.backgroundable = backgroundable

		self["key_green"] = StaticText("")

		if self.job.IN_PROGRESS:
			self["key_red"] = StaticText(_("Job cancel"))
		else:
			self["key_red"] = StaticText("")

		if self.job.IN_PROGRESS:
			self["key_blue"] = StaticText(_("Continue in background"))
			self["key_green"] = StaticText(_("OK"))
		else:
			self["key_blue"] = StaticText("")

		self.onShow.append(self.windowShow)
		self.onHide.append(self.windowHide)

		self["setupActions"] = ActionMap(["ColorActions", "SetupActions"],
		{
			"green": self.ok,
			"red": self.abort,
			"blue": self.background,
			"ok": self.ok,
		}, -2)

		self.settings = ConfigSubsection()
		if BoxInfo.getItem("DeepstandbySupport"):
			shutdownString = _("go to deep standby")
		else:
			shutdownString = _("shut down")
		self.settings.afterEvent = ConfigSelection(choices=[("nothing", _("do nothing")), ("close", _("Close")), ("standby", _("go to standby")), ("deepstandby", shutdownString)], default=self.job.afterEvent or "nothing")
		self.job.afterEvent = self.settings.afterEvent.getValue()
		self.afterEventChangeable = afterEventChangeable
		self.setupList()
		self.state_changed()
Esempio n. 10
0
    def __init__(self, session, project=None):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)

        self["titleactions"] = HelpableActionMap(
            self, "TitleList", {
                "addTitle":
                (self.addTitle, _("Add a new title"), _("Add title")),
                "titleProperties":
                (self.titleProperties, _("Properties of current title"),
                 _("Title properties")),
                "removeCurrentTitle":
                (self.removeCurrentTitle, _("Remove currently selected title"),
                 _("Remove title")),
                "settings":
                (self.settings, _("Collection settings"), _("Settings")),
                "burnProject": (self.askBurnProject, _("Burn to medium"),
                                _("Burn to medium")),
            })

        self["MovieSelectionActions"] = HelpableActionMap(
            self, "MovieSelectionActions", {
                "contextMenu": (self.showMenu, _("menu")),
            })

        self["actions"] = ActionMap(["OkCancelActions"],
                                    {"cancel": self.leave})

        self["key_red"] = StaticText()
        self["key_green"] = StaticText(_("Add title"))
        self["key_yellow"] = StaticText()
        self["key_blue"] = StaticText(_("Settings"))

        self["title_label"] = StaticText()
        self["error_label"] = StaticText()
        self["space_label"] = StaticText()
        self["hint"] = StaticText(_("Advanced Options"))
        self["medium_label"] = MultiColorLabel()
        self["space_bar_single"] = Progress()
        self["space_bar_dual"] = Progress()
        self["space_bar_bludisc"] = Progress()
        self["marker_single"] = StaticText(("SINGLE"))
        self["marker_dvd"] = StaticText(("DVD"))
        self["marker_dual"] = StaticText(("DUAL"))
        self["marker_bludisc"] = StaticText(("BLUDISC"))

        self["titles"] = List([])
        self.previous_size = 0
        if project is not None:
            self.project = project
        else:
            self.newProject()
        self.onLayoutFinish.append(self.layoutFinished)
Esempio n. 11
0
 def __init__(self, session, job, parent = None, cancelable = True, backgroundable = True, afterEventChangeable = True):
     from Components.Sources.StaticText import StaticText
     from Components.Sources.Progress import Progress
     from Components.Sources.Boolean import Boolean
     from Components.ActionMap import ActionMap
     Screen.__init__(self, session, parent)
     InfoBarNotifications.__init__(self)
     ConfigListScreen.__init__(self, [])
     self.parent = parent
     self.session = session
     try:
         txt=open("/tmp/filesize").read()
         self.size="Size "+str(int(txt)/(1024*1024))+"MB"
        
     except:
         self.size="000"
        
     self.job = job
     self['pixmap'] = Pixmap()
     self['job_name'] = StaticText(job.name)
     self['job_progress'] = Progress()
     self['job_task'] = StaticText()
     self['summary_job_name'] = StaticText(job.name)
     self['summary_job_progress'] = Progress()
     self['summary_job_task'] = StaticText()
     self['job_status'] = StaticText(job.name)
     self['finished'] = Boolean()
     self['cancelable'] = Boolean(cancelable)
     self['cancelable'].boolean = True
     self['backgroundable'] = Boolean(backgroundable)
     self['key_blue'] = StaticText(_('Background'))
     
     self.onShow.append(self.windowShow)
     self.onHide.append(self.windowHide)
     self['setupActions'] = ActionMap(['ColorActions', 'SetupActions'], {'green': self.ok,
      'red': self.abort,
      'blue': self.background,
      'cancel': self.ok,
      'ok': self.ok}, -2)
     self.settings = ConfigSubsection()
     if SystemInfo['DeepstandbySupport']:
         shutdownString = _('go to standby')
     else:
         shutdownString = _('shut down')
     self.settings.afterEvent = ConfigSelection(choices=[('nothing', _('do nothing')),
      ('close', _('Close')),
      ('standby', _('go to idle mode')),
      ('deepstandby', shutdownString)], default=self.job.afterEvent or 'nothing')
     self.job.afterEvent = self.settings.afterEvent.getValue()
     self.afterEventChangeable = afterEventChangeable
     self.setupList()
     self.state_changed()
Esempio n. 12
0
	def __init__(self, session, args = 0):
		self.printconfig()
		self.session = session
		Screen.__init__(self, session)
		Screen.setTitle(self, _("AutoBouquetsMaker"))

		self["background"] = Pixmap()
		self["action"] = Label(_("Starting scanner"))
		self["status"] = Label("")
		self["progress"] = ProgressBar()
		self["progress_text"] = Progress()

		self.frontend = None
		self.rawchannel = None
		self.postScanService = None
		self.providers = Manager().getProviders()

		# dependent providers
		self.dependents = {}
		for provider_key in self.providers:
			if len(self.providers[provider_key]["dependent"]) > 0 and self.providers[provider_key]["dependent"] in self.providers:
				if self.providers[provider_key]["dependent"] not in self.dependents:
					self.dependents[self.providers[provider_key]["dependent"]] = []
				self.dependents[self.providers[provider_key]["dependent"]].append(provider_key)

		# get ABM config string including dependents
		self.abm_settings_str = self.getABMsettings()

		self.actionsList = []

		self.onFirstExecBegin.append(self.firstExec)
    def __init__(self, session):
        Screen.__init__(self, session)

        self["key_red"] = StaticText(_("Exit"))
        self["key_green"] = StaticText(_("Update"))
        self["key_yellow"] = StaticText()

        self["space_label"] = StaticText()
        self["space_bar"] = Progress()

        self.mediuminfo = []
        self.formattable = False
        self["details"] = ScrollLabel()
        self["info"] = StaticText()

        self["toolboxactions"] = ActionMap(
            ["ColorActions", "DVDToolbox", "OkCancelActions"], {
                "red": self.exit,
                "green": self.update,
                "yellow": self.format,
                "cancel": self.exit,
                "pageUp": self.pageUp,
                "pageDown": self.pageDown
            })
        self.update()
        hotplugNotifier.append(self.update)
        self.onLayoutFinish.append(self.layoutFinished)
Esempio n. 14
0
 def __init__(self, session, parent):
     Screen.__init__(self, session, parent)
     self["title"] = StaticText(_("Image flash utility"))
     self["content"] = StaticText(
         _("Please select .NFI flash image file from medium"))
     self["job_progressbar"] = Progress()
     self["job_progresslabel"] = StaticText("")
    def __init__(self, session, providers, pcallback=None, noosd=False):
        from Components.Sources.StaticText import StaticText
        from Components.Sources.Progress import Progress
        if (getDesktop(0).size().width() < 800):
            skin = "%s/skins/downloader_sd.xml" % os.path.dirname(
                sys.modules[__name__].__file__)
            self.isHD = 0
        else:
            skin = "%s/skins/downloader_hd.xml" % os.path.dirname(
                sys.modules[__name__].__file__)
            self.isHD = 1
        f = open(skin, "r")
        self.skin = f.read()
        f.close()
        Screen.__init__(self, session)

        self.session = session

        self["background"] = Pixmap()
        self["action"] = Label(_("Starting downloader"))
        self["status"] = Label("")
        self["progress"] = ProgressBar()
        self["progress"].hide()
        self["summary_action"] = StaticText(_("Starting downloader"))
        self["summary_status"] = StaticText()
        self["summary_progress"] = Progress()
        self["actions"] = NumberActionMap(["WizardActions", "InputActions"],
                                          {"back": self.quit}, -1)

        self.frontend = None
        self.rawchannel = None
        self.retValue = True
        self.provider_index = 0
        self.status = 0
        self.open = False
        self.saved = False
        self.oldService = None
        self.config = CrossEPG_Config()
        self.config.load()
        self.providers = providers
        self.pcallback = pcallback

        self.wrapper = CrossEPG_Wrapper()
        self.wrapper.addCallback(self.wrapperCallback)

        self.hideprogress = eTimer()
        self.hideprogress.callback.append(self["progress"].hide)

        self.pcallbacktimer = eTimer()
        self.pcallbacktimer.callback.append(self.doCallback)

        self.wrappertimer = eTimer()
        self.wrappertimer.callback.append(self.initWrapper)

        if noosd:
            self.wrappertimer.start(100, 1)
        else:
            self.onFirstExecBegin.append(self.firstExec)
Esempio n. 16
0
    def __init__(self, session, args=0):
        print "[MisPlsLcnScan][__init__] Starting..."
        print "[MisPlsLcnScan][__init__] args", args
        self.session = session
        Screen.__init__(self, session)
        Screen.setTitle(self, _("MIS/PLS LCN Scan"))

        self["background"] = Pixmap()
        self["action"] = Label(_("Starting scanner"))
        self["status"] = Label("")
        self["progress"] = ProgressBar()
        self["progress_text"] = Progress()

        self["actions"] = ActionMap(["SetupActions"], {
            "cancel": self.keyCancel,
        }, -2)

        self.selectedNIM = -1
        self.FTA_only = config.plugins.MisPlsLcnScan.onlyfree.value
        self.networkid = 0
        self.restrict_to_networkid = False
        if args:
            pass
        self.frontend = None
        self["Frontend"] = FrontendStatus(
            frontend_source=lambda: self.frontend, update_interval=100)
        self.rawchannel = None
        self.session.postScanService = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        self.index = 0
        self.LOCK_TIMEOUT_ROTOR = 1200  # 100ms for tick - 120 sec
        self.LOCK_TIMEOUT_FIXED = 50  # 100ms for tick - 5 sec

        self.path = "/etc/enigma2"
        self.services_dict = {}
        self.tmp_services_dict = {}
        self.namespace_dict = {
        }  # to store namespace when sub network is enabled
        self.logical_channel_number_dict = {}
        self.ignore_visible_service_flag = False  # make this a user override later if found necessary
        self.VIDEO_ALLOWED_TYPES = [1, 4, 5, 17, 22, 24, 25, 27, 135]
        self.AUDIO_ALLOWED_TYPES = [2, 10]
        self.BOUQUET_PREFIX = "userbouquet.MisPlsLcnScan."
        self.bouquetsIndexFilename = "bouquets.tv"
        self.bouquetFilename = self.BOUQUET_PREFIX + config.plugins.MisPlsLcnScan.provider.value + ".tv"
        self.bouquetName = PROVIDERS[config.plugins.MisPlsLcnScan.provider.
                                     value]["name"]  # already translated
        self.namespace_complete = not (
            config.usage.subnetwork.value
            if hasattr(config.usage, "subnetwork") else True
        )  # config.usage.subnetwork not available in all images

        self.LOCK_TIMEOUT = self.LOCK_TIMEOUT_FIXED
        self.scanTransponders = self.getMisTransponders(
            PROVIDERS[config.plugins.MisPlsLcnScan.provider.value]["orb_pos"])
        self.transponders_correct_onid = []
        self.onClose.append(self.__onClose)
        self.onFirstExecBegin.append(self.firstExec)
Esempio n. 17
0
    def __init__(self, session, pcallback=None, noosd=False):
        self.session = session
        if (getDesktop(0).size().width() < 800):
            skin = "%s/skins/downloader_sd.xml" % os.path.dirname(
                sys.modules[__name__].__file__)
            self.isHD = 0
        else:
            skin = "%s/skins/downloader_hd.xml" % os.path.dirname(
                sys.modules[__name__].__file__)
            self.isHD = 1
        f = open(skin, "r")
        self.skin = f.read()
        f.close()
        Screen.__init__(self, session)
        self.skinName = "downloader"
        Screen.setTitle(self, _("CrossEPG"))

        self["background"] = Pixmap()
        self["action"] = Label(_("Starting importer"))
        self["summary_action"] = StaticText(_("Starting importer"))
        self["status"] = Label("")
        self["progress"] = ProgressBar()
        self["progress"].hide()
        self["progress_text"] = Progress()
        self["actions"] = NumberActionMap(["WizardActions", "InputActions"],
                                          {"back": self.quit}, -1)

        self.retValue = True
        self.config = CrossEPG_Config()
        self.config.load()
        self.lamedb = self.config.lamedb
        if getImageDistro() != "openvix":
            self.db_root = self.config.db_root
        else:
            self.db_root = config.misc.epgcachepath.value + 'crossepg'
        if not pathExists(self.db_root):
            if not createDir(self.db_root):
                self.db_root = "/hdd/crossepg"

        self.pcallback = pcallback

        self.wrapper = CrossEPG_Wrapper()
        self.wrapper.addCallback(self.wrapperCallback)

        self.hideprogress = eTimer()
        self.hideprogress.callback.append(self["progress"].hide)

        self.pcallbacktimer = eTimer()
        self.pcallbacktimer.callback.append(self.doCallback)

        self.status = 0

        if noosd:
            self.wrappertimer = eTimer()
            self.wrappertimer.callback.append(self.startWrapper)
            self.wrappertimer.start(100, 1)
        else:
            self.onFirstExecBegin.append(self.firstExec)
Esempio n. 18
0
    def __init__(self, session, daemon, torrent, prevFunc=None, nextFunc=None):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        self.transmission = daemon
        self.torrentid = torrent.id
        self.prevFunc = prevFunc
        self.nextFunc = nextFunc

        self["ChannelSelectBaseActions"] = HelpableActionMap(
            self, "ChannelSelectBaseActions", {
                "prevMarker":
                (self.prevDl, _("show previous download details")),
                "nextMarker": (self.nextDl, _("show next download details")),
            })

        self["SetupActions"] = HelpableActionMap(
            self, "SetupActions", {
                "ok": (self.ok, _("toggle file status")),
                "cancel": self.close,
            })

        self["ColorActions"] = HelpableActionMap(
            self, "ColorActions", {
                "yellow": (self.toggleStatus, _("toggle download status")),
                "green": (self.bandwidth, _("open bandwidth settings")),
                "blue": (self.remove, _("remove torrent")),
            })

        self["key_red"] = StaticText(_("Close"))
        self["key_green"] = StaticText(_("Bandwidth"))
        if torrent.status == "stopped":
            self["key_yellow"] = StaticText(_("start"))
        else:
            self["key_yellow"] = StaticText(_("stop"))
        self["key_blue"] = StaticText(_("remove"))

        self["upspeed"] = StaticText("")
        self["downspeed"] = StaticText("")
        self["peers"] = StaticText("")
        self["name"] = StaticText(str(torrent.name))
        self["files_text"] = StaticText(_("Files"))
        self["files"] = List([])
        self["progress"] = Progress(int(torrent.progress))
        self["progress_text"] = StaticText("")
        self["ratio"] = StaticText("")
        self["eta"] = StaticText("")
        self["tracker"] = StaticText("")
        self["private"] = StaticText("")

        self.timer = eTimer()
        self.timer.callback.append(self.updateList)
        self.timer.start(0, 1)
Esempio n. 19
0
	def __init__(self, session, args = 0):
		global LastVLT
		global LastPWM
		self.session = session
		Screen.__init__(self, session)

		self.fan_timer = eTimer()
		self.fan_timer.callback.append(self.updateFanStatus)

		self.list = []
		self.list.append(getConfigListEntry(_("Fan type"), config.plugins.FanControl.Fan))
		self.list.append(getConfigListEntry(_("Fan off in Idle Mode"), config.plugins.FanControl.StandbyOff))
		self.list.append(getConfigListEntry(_("min Speed rpm"), config.plugins.FanControl.minRPM))
		self.list.append(getConfigListEntry(_("max Speed rpm"), config.plugins.FanControl.maxRPM))
		self.list.append(getConfigListEntry(_("Static temp C"), config.plugins.FanControl.temp))
		self.list.append(getConfigListEntry(_("End temperature C"), config.plugins.FanControl.tempmax))
		self.list.append(getConfigListEntry(_("Initial Voltage"), config.plugins.FanControl.vlt))
		self.list.append(getConfigListEntry(_("Initial PWM"), config.plugins.FanControl.pwm))
		ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.selectionChanged)
		LastVLT = config.plugins.FanControl.vlt.value
		LastPWM = config.plugins.FanControl.pwm.value

		self["key_red"] = self["red"] = StaticText(_("Cancel"))
		self["key_green"] = self["green"] = StaticText(_("Save"))
		self["key_yellow"] = self["yellow"] = StaticText(_("Check"))
		self["key_blue"] = self["blue"] = StaticText(_("Help"))
		self["introduction"] = StaticText()
		self["Version"] = StaticText(Version)
		self["TxtTemp"] = StaticText()
		self["TxtZielRPM"] = StaticText()
		self["TxtRPM"] = StaticText()
		self["TxtVLT"] = StaticText()
		self["TxtPWM"] = StaticText()
		self["PixTemp"] = Progress()
		self["PixZielRPM"] = Progress()
		self["PixRPM"] = Progress()
		self["PixVLT"] = Progress()
		self["PixPWM"] = Progress()
		self["PixERR"] = Progress()
		self["TxtERR"] = StaticText()
		self["T10ERR"] = StaticText()

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "MenuActions", "EPGSelectActions"],
		{
			"ok": self.save,
			"cancel": self.cancel,
			"red": self.cancel,
			"green": self.save,
			"yellow": self.pruefen,
			"blue": self.help,
			"menu": self.SetupMenu,
		}, -1)

		if not self.selectionChanged in self["config"].onSelectionChanged:
			self["config"].onSelectionChanged.append(self.selectionChanged)
		self.selectionChanged()
		self.onLayoutFinish.append(self.updateFanStatus)
Esempio n. 20
0
    def __init__(self, session, args=0):
        self.printconfig()
        self.session = session
        Screen.__init__(self, session)
        Screen.setTitle(self, _("AutoBouquetsMaker"))

        self.frontend = None
        self.rawchannel = None
        self.postScanService = None
        self.providers = Manager().getProviders()

        self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], {
            "cancel": self.keyCancel,
            "red": self.keyCancel,
        }, -2)

        #		self["background"] = Pixmap()
        self["action"] = Label(_("Starting scanner"))
        self["status"] = Label("")
        self["progress"] = ProgressBar()
        self["progress_text"] = Progress()
        self["tuner_text"] = Label("")
        self["Frontend"] = FrontendStatus(
            frontend_source=lambda: self.frontend, update_interval=100)

        # dependent providers
        self.dependents = {}
        for provider_key in self.providers:
            if len(self.providers[provider_key]
                   ["dependent"]) > 0 and self.providers[provider_key][
                       "dependent"] in self.providers:
                if self.providers[provider_key][
                        "dependent"] not in self.dependents:
                    self.dependents[self.providers[provider_key]
                                    ["dependent"]] = []
                self.dependents[self.providers[provider_key]
                                ["dependent"]].append(provider_key)

        # get ABM config string including dependents
        self.abm_settings_str = self.getABMsettings()

        self.actionsList = []

        self.onFirstExecBegin.append(self.firstExec)
Esempio n. 21
0
    def __init__(self, session, cancelable=True, close_on_finish=False):
        self.skin = NFIFlash.skin
        Screen.__init__(self, session)

        self["job_progressbar"] = Progress()
        self["job_progresslabel"] = StaticText("")

        self["finished"] = Boolean()

        self["infolabel"] = StaticText("")
        self["statusbar"] = StaticText(
            _("Please select .NFI flash image file from medium"))
        self["listlabel"] = StaticText(_("select .NFI flash file") + ":")

        self["key_green"] = StaticText()
        self["key_yellow"] = StaticText()
        self["key_blue"] = StaticText()

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions", "DirectionActions"], {
                "green": self.ok,
                "yellow": self.reboot,
                "blue": self.runWizard,
                "ok": self.ok,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down
            }, -1)

        currDir = "/media/usb/"
        self.filelist = FileList(currDir, matchingPattern="^.*\.(nfi|NFI)")
        self["filelist"] = self.filelist
        self.nfifile = ""
        self.md5sum = ""
        self.job = None
        self.box = HardwareInfo().get_device_name()
        self.configuration_restorable = None
        self.wizard_mode = False
        from enigma import eTimer
        self.delayTimer = eTimer()
        self.delayTimer.callback.append(self.runWizard)
        self.delayTimer.start(50, 1)
Esempio n. 22
0
		def __init__(self, session):
				global count
				self.skin = Ttimer.skin
				Screen.__init__(self, session)
				if config.osd.language.value == "es_ES":
					self['srclabel'] = Label(_("Por favor Espere, Actualizando Epg"))
				else:
					self['srclabel'] = Label(_("Please wait, Updating Epg"))
				if config.osd.language.value == "es_ES":
					self.setTitle(_("Actualizando EPG"))
				else:
					self.setTitle(_("Update EPG"))
				self["progress"] = Progress(int(count))
				self['progress'].setRange(int(config.plugins.LDteam.epgmhw2wait.value-5))
				self.session = session
				self.ctimer = enigma.eTimer()
				count = 0
				self.ctimer.callback.append(self.__run)
				self.ctimer.start(1000,0)
Esempio n. 23
0
	def __init__(self, session, project = None):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		
		self["titleactions"] = HelpableActionMap(self, "DVDTitleList",
			{
				"addTitle": (self.addTitle, _("Add a new title"), _("Add title")),
				"titleProperties": (self.titleProperties, _("Properties of current title"), _("Title properties")),
				"removeCurrentTitle": (self.removeCurrentTitle, _("Remove currently selected title"), _("Remove title")),
				"settings": (self.settings, _("Collection settings"), _("Settings")),
				"burnProject": (self.askBurnProject, _("Burn DVD"), _("Burn DVD")),
			})

		self["MovieSelectionActions"] = HelpableActionMap(self, "MovieSelectionActions",
			{
				"contextMenu": (self.showMenu, _("menu")),
			})

		self["actions"] = ActionMap(["OkCancelActions"],
			{
				"cancel": self.leave
			})

		self["key_red"] = StaticText()
		self["key_green"] = StaticText(_("Add title"))
		self["key_yellow"] = StaticText()
		self["key_blue"] = StaticText(_("Settings"))

		self["title_label"] = StaticText()
		self["error_label"] = Label("")
		self["space_label"] = StaticText()
		self["space_bar"] = Progress()

		if project is not None:
			self.project = project
		else:
			self.newProject()

		self["titles"] = List(list = [ ], enableWrapAround = True, item_height=30, fonts = [gFont("Regular", 20)])
		self.updateTitleList()
		self.previous_size = 0
	def __init__(self, session, args = 0):
		print "[RadioTimesEmulator][__init__] Starting..."
		print "[RadioTimesEmulator][__init__] args", args
		self.session = session
		Screen.__init__(self, session)
		Screen.setTitle(self, _("Radio Times Emulator Download"))

		if not inStandby:
			self["action"] = Label(_("Starting downloader"))
			self["status"] = Label("")
			self["progress"] = ProgressBar()
			self["progress_text"] = Progress()
			self["tuner_text"] = Label("")

		self["actions"] = ActionMap(["SetupActions"],
		{
			"cancel": self.keyCancel,
		}, -2)

		self.selectedNIM = -1
		if args:
			pass
		self.frontend = None
		if not inStandby:
			self["Frontend"] = FrontendStatus(frontend_source = lambda : self.frontend, update_interval = 100)
		self.rawchannel = None
#		self.session.postScanService = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		self.postScanService = None
		self.index = 0
		self.LOCK_TIMEOUT_ROTOR = 1200 	# 100ms for tick - 120 sec
		self.LOCK_TIMEOUT_FIXED = 50 	# 100ms for tick - 5 sec
		
		self.LOCK_TIMEOUT = self.LOCK_TIMEOUT_FIXED
		self.databaseLocation = "%sradiotimes" % config.plugins.RadioTimesEmulator.database_location.value
		self.providers = Providers().read()
		self.onClose.append(self.__onClose)
		self.onFirstExecBegin.append(self.firstExec)
    def __init__(self, session):
        from Components.Sources.StaticText import StaticText
        if (getDesktop(0).size().width() < 800):
            skin = "%s/skins/downloader_sd.xml" % os.path.dirname(
                sys.modules[__name__].__file__)
            self.isHD = 0
        else:
            skin = "%s/skins/downloader_hd.xml" % os.path.dirname(
                sys.modules[__name__].__file__)
            self.isHD = 1
        f = open(skin, "r")
        self.skin = f.read()
        f.close()
        Screen.__init__(self, session)
        self.skinName = "downloader"
        Screen.setTitle(self, _("CrossEPG"))

        self.onChangedEntry = []
        self.sources = []
        self.session = session
        self.mirrors = []

        self["background"] = Pixmap()
        self["action"] = Label(_("Updating rytec providers..."))
        self["summary_action"] = StaticText(_("Updating rytec providers..."))
        self["status"] = Label("")
        self["progress"] = ProgressBar()
        self["progress"].hide()
        self["progress_text"] = Progress()

        self.config = CrossEPG_Config()
        self.config.load()

        self.timer = eTimer()
        self.timer.callback.append(self.start)

        self.onFirstExecBegin.append(self.firstExec)
	def __init__(self, session,zipFile,gerados={}):
		Screen.__init__(self, session)
		self.skin=ProgressoGeradorScreen.skin

		self["Title"].text=utils._title

		self.onFirstExecBegin.append(self.windowShow)
		self.gerados=gerados

		self.progress=Progress()

		self.jobName=StaticText()
		self.jobTask=StaticText()
		self["job_progress"]=self.progress

		self["job_name"]=self.jobName
		self["job_task"]=self.jobTask

		self.progress.setRange(len(gerados))
		self.progress.value=0

		self.total=len(gerados)
		utils.addScreen(self)
		self.zipFile=zipFile
Esempio n. 27
0
class SmartConsole(Screen):
    def __init__(self,
                 session,
                 title=_('Command execution...'),
                 cmdlist=[],
                 cmdmax=None,
                 finishedCallback=None,
                 closeOnSuccess=False,
                 progressmode=True):
        Screen.__init__(self, session)
        self.finishedCallback = finishedCallback
        self.closeOnSuccess = closeOnSuccess
        self.cmdmax = cmdmax or len(cmdlist)
        self.progressmode = progressmode
        self.slider = Progress(0, 1000)
        self['slider'] = self.slider
        self.activityslider = Progress(0, 1000)
        self['activityslider'] = self.activityslider
        self.status = StaticText('')
        self['status'] = self.status
        self.text = StaticText('')
        self['text'] = self.text
        self.helpinfo = StaticText('')
        self['helpinfo'] = self.helpinfo
        self.activity = 0
        self.activityTimer = eTimer()
        self.activityTimer.callback.append(self.doActivityTimer)
        self.console = StaticText(None)
        self['console'] = self.console
        self.consolestatus = StaticText(None)
        self['consolestatus'] = self.consolestatus
        self['actions'] = ActionMap(
            ['WizardActions', 'DirectionActions', 'TimerEditActions'], {
                'ok': self.ok,
                'back': self.cancel,
                'up': self.up,
                'down': self.down,
                'left': self.left,
                'right': self.right,
                'log': self.swapMode
            }, -1)
        size = getDesktop(0).size()
        self.fullsize = eSize(size.width() - 100, size.height() - 100)
        self.fullpos = ePoint(50, 50)
        self.cmdlist = cmdlist
        self.newtitle = title
        self.block = False
        self.text_long = ''
        self.stat_long = ''
        self.ret = 0
        self.run = 0
        self.container = eConsoleAppContainer()
        self.container.appClosed.append(self.runFinished)
        self.container.dataAvail.append(self.dataAvail)
        self.flagexit = False
        self.animation = False
        self.animationstep = 1 if HardwareInfo().get_device_model(
        ) == 'dm8000' else 15
        self.onClose.append(self._onClose)
        self.onLayoutFinish.append(self._onLayoutFinish)
        return

    def _onLayoutFinish(self):
        self.setTitle(self.newtitle)
        self.position = self.instance.position()
        self.size = self.instance.size()
        self.setMode()
        self.helpinfo.setText(_('Press INFO for show logging'))
        console = self.getRendererByName('console')
        console and console.onAnimationEnd.append(self.__onAnimationEnd)
        self.instance.animationEnd.get().append(self._onAnimationEnd)
        self.startRun()

    def _onClose(self):
        self.instance.animationEnd.get().remove(self._onAnimationEnd)
        del self.container.dataAvail[:]
        del self.container.appClosed[:]
        del self.container
        console = self.getRendererByName('console')
        if console:
            console.onAnimationEnd.remove(self.__onAnimationEnd)
        if self.finishedCallback is not None:
            self.stopActivityTimer()
            self.finishedCallback()
        return

    def ok(self):
        if self.run == self.cmdmax and not self.isRunning():
            if not self.progressmode and not self.animation and self.animationstep != 1:
                self.animation = True
                self.flagexit = True
                self.console.setText(None)
                self.instance.startMoveAnimation(self.position, self.size,
                                                 self.animationstep, 10, 1)
            else:
                self.close()
        else:
            self.swapMode()
        return

    def cancel(self):
        if self.run == self.cmdmax and not self.isRunning():
            if not self.progressmode and not self.animation and self.animationstep != 1:
                self.animation = True
                self.flagexit = True
                self.console.setText(None)
                self.instance.startMoveAnimation(self.position, self.size,
                                                 self.animationstep, 10, 1)
            else:
                self.close()
        else:
            self.session.openWithCallback(
                self.cancelCB,
                MessageBox,
                _('Do you really want to end the task?'),
                default=False,
                timeout=10)
        return

    def cancelCB(self, answer):
        if answer:
            self.close()

    def swapMode(self):
        self.progressmode = not self.progressmode
        self.setMode()

    def setMode(self):
        if self.progressmode:
            self.animation = True
            self.console.setText(None)
            self.text.setText(None)
            if self.run != self.cmdmax or self.isRunning():
                self.startActivityTimer()
            self.slider.setValue(int(self.run * 1000 / self.cmdmax))
            self.status.setText(self.stat_long)
            self.consolestatus.setText(None)
            self.helpinfo.setText(_('Press INFO for show logging'))
            self.instance.startMoveAnimation(self.position, self.size,
                                             self.animationstep, 10, 1)
        elif config.usage.setup_level.index > 1:
            self.animation = True
            self.console.setText(None)
            self.text.setText(None)
            self.stopActivityTimer()
            self.slider.setValue(None)
            self.status.setText(None)
            self.consolestatus.setText(self.stat_long)
            self.helpinfo.setText(_('Press INFO for hide logging'))
            self.instance.startMoveAnimation(self.fullpos, self.fullsize,
                                             self.animationstep, 10, 1)
        return

    def left(self):
        if self.progressmode:
            self.swapMode()
        if self.animation:
            return
        self.animation = True
        self.renders['console'].scrollPageUp()

    def right(self):
        if self.progressmode:
            self.swapMode()
        if self.animation:
            return
        self.animation = True
        self.renders['console'].scrollPageDown()

    def up(self):
        if self.progressmode:
            self.swapMode()
        if self.animation:
            return
        self.animation = True
        self.renders['console'].scrollUp()

    def down(self):
        if self.progressmode:
            self.swapMode()
        if self.animation:
            return
        self.animation = True
        self.renders['console'].scrollDown()

    def doActivityTimer(self):
        self.activity += 10
        if self.activity == 1000:
            self.activity = 0
        self.activityslider.setValue(self.activity)

    def startActivityTimer(self):
        self.activityTimer.start(100, False)

    def stopActivityTimer(self):
        self.activityTimer.stop()
        self.activityslider.setValue(None)
        return

    def isRunning(self):
        return self.container.running()

    def startRun(self):
        self.startActivityTimer()
        self.runFinished(self.ret)

    def runFinished(self, retval):
        self.ret = retval
        if self.block:
            return
        else:
            if self.run < len(self.cmdlist):
                cmd = self.cmdlist[self.run]
                self.run += 1
                if isinstance(cmd, (list, tuple, dict)):
                    self.stat_long = cmd[1]
                    cmd = cmd[0]
                if self.progressmode:
                    self.slider.setValue(int(self.run * 1000 / self.cmdmax))
                    self.status.setText(self.stat_long)
                else:
                    self.consolestatus.setText(self.stat_long)
                print '[SmartConsole] executing in run', self.run, '/', self.cmdmax, ' the command:', cmd
                if self.container.execute(cmd):
                    self.runFinished(-1)
            elif self.run == self.cmdmax:
                self.stopActivityTimer()
                if not retval and self.closeOnSuccess:
                    if not self.progressmode and not self.animation and self.animationstep != 1:
                        self.animation = True
                        self.flagexit = True
                        self.console.setText(None)
                        self.instance.startMoveAnimation(
                            self.position, self.size, self.animationstep, 10,
                            1)
                    else:
                        self.close()
            return
            return

    def dataAvail(self, s=''):
        self.text_long += s
        if self.animation:
            return
        if self.progressmode:
            self.text.setText(
                self.text_long.strip().strip('\n').strip().strip('\n'))
        else:
            self.console.setText(
                self.text_long.strip().strip('\n').strip().strip('\n'))

    def addCmd(self,
               cmdlist,
               cmdmax=None,
               finishedCallback=None,
               closeOnSuccess=False):
        self.block = True
        self.cmdlist = self.cmdlist + cmdlist
        self.cmdmax = cmdmax or len(self.cmdlist)
        self.finishedCallback = finishedCallback
        self.closeOnSuccess = closeOnSuccess
        self.block = False
        if not self.isRunning():
            self.runFinished(self.ret)

    def __onAnimationEnd(self):
        self.animation = False

    def _onAnimationEnd(self):
        self.animation = False
        if self.flagexit:
            self.close()
        else:
            self.dataAvail()
class ProgressoGeradorScreen(Screen):

	skin="""
			<screen name="ProgressoGerador" position="center,center" size="723,500" title="Gerador de Picons">
			      <widget source="job_name" render="Label" position="65,147" size="600,35" font="Regular;28" />
			      <widget source="job_task" render="Label" position="65,216" size="600,30" font="Regular;24" />
			      <widget source="job_progress" render="Progress" position="65,291" size="600,36" borderWidth="2" backgroundColor="#254f7497" />
			      <widget source="job_progress" render="Label" position="160,294" size="410,32" font="Regular;28" foregroundColor="#000000" zPosition="2" halign="center" transparent="1">
			        <convert type="ProgressToText" />
			      </widget>
			</screen>
	"""
	            # <widget source="job_progress" render="Progress" position="590,260" size="600,36" borderWidth="2" backgroundColor="#254f7497" />

	def __init__(self, session,zipFile,gerados={}):
		Screen.__init__(self, session)
		self.skin=ProgressoGeradorScreen.skin

		self["Title"].text=utils._title

		self.onFirstExecBegin.append(self.windowShow)
		self.gerados=gerados

		self.progress=Progress()

		self.jobName=StaticText()
		self.jobTask=StaticText()
		self["job_progress"]=self.progress

		self["job_name"]=self.jobName
		self["job_task"]=self.jobTask

		self.progress.setRange(len(gerados))
		self.progress.value=0

		self.total=len(gerados)
		utils.addScreen(self)
		self.zipFile=zipFile


	def windowShow(self):
		self.jobName.text="Preparando..."
		self.wrappertimer = eTimer()
		self.wrappertimer.callback.append(self.processar)
		self.wrappertimer.start(10, True)

	def processar(self):
		if self.gerados:
			piconsDir=config.plugins.geradorpicon.pasta.value

			try:
				os.makedirs(piconsDir)
			except OSError as exception:
				pass

			from enigma import eServiceCenter
			servicehandler = eServiceCenter.getInstance()

			canal = self.gerados.keys().pop()
			if canal:
				picon = self.gerados[canal]
				del self.gerados[canal]
				nome = servicehandler.info(canal).getName(canal).lower()
				self.jobName.text = "Processando canal %s" % (nome)
				if picon:
					piconName = piconsDir + "/" + picon.getPiconByName() if config.plugins.geradorpicon.porNome.value else  picon.getPiconName()
					self.jobTask.text = "Copiando arquivo..."

					shutil.copy(picon.tmpPng,piconName)


				self.progress.value = self.total-len(self.gerados)
				self.wrappertimer.start(10, True)
		else:
			self.jobName.text="Concluído!"
			self.jobTask.text=""
			self.timer = eTimer()
			self.timer.callback.append(self.close)
			self.timer.start(2000,True)
Esempio n. 29
0
    def __init__(self, session, EIB_objects):
        skin = """
		<screen position="center,center" size="550,450" title="E.I.B.ox" >
			<widget name="config" position="10,420" size="530,26" zPosition="1" transparent="1" scrollbarMode="showNever" />
			<ePixmap pixmap="%s" position="0,0" size="550,400" zPosition="-1" alphatest="on" />\n""" % (
            img_prefix + EIB_objects.zone_img)

        offset = [12, 10]  # fix up browser css spacing
        iconsize = [32, 32]

        self.setup_title = "E.I.B.ox"

        self.EIB_objects = EIB_objects
        for EIB_object in self.EIB_objects:
            if EIB_object.object_type == EIB_GOTO:
                pixmap_src = (img_prefix + 'goto' +
                              EIB_object.img.capitalize() + '.png')
                skin += '\t\t\t<widget name="%s" pixmap="%s" position="%s" size="32,32" transparent="1" alphatest="on" borderColor="#004679" zPosition="1" />\n' % (
                    EIB_object.object_id, pixmap_src,
                    EIB_object.getPos(offset))
                self[EIB_object.object_id] = Pixmap()

            elif EIB_object.object_type in (EIB_SWITCH, EIB_MULTISWITCH,
                                            EIB_DIMMER):
                if EIB_object.object_type == EIB_DIMMER or EIB_object.img == "light":
                    pixmaps_sources = ['light_off.png', 'light_on.png']
                elif EIB_object.img == "blinds":
                    pixmaps_sources = ['blinds_up.png', 'blinds_down.png']
                elif EIB_object.img == "outlet":
                    pixmaps_sources = ['outlet_off.png', 'outlet_on.png']
                elif EIB_object.img == "fan":
                    pixmaps_sources = ['fan_off.png', 'fan_on.png']
                elif EIB_object.img == "pump":
                    pixmaps_sources = ['pump_off.png', 'pump_on.png']
                else:
                    pixmaps_sources = list(EIB_object.custom_img)

                for idx, filename in enumerate(pixmaps_sources):
                    pixmaps_sources[idx] = img_prefix + filename
                pixmaps_string = ','.join(pixmaps_sources)
                skin += '\t\t\t<widget name="%s" pixmaps="%s" position="%s" size="32,32" transparent="1" alphatest="on" borderColor="#004679" zPosition="1" />\n' % (
                    EIB_object.object_id, pixmaps_string,
                    EIB_object.getPos(offset))
                self[EIB_object.object_id] = MultiPixmap()

                if EIB_object.object_type == EIB_DIMMER:
                    skin += '\t\t\t<widget source="%s_progress" render="Progress" pixmap="skin_default/progress_small.png" position="%s" size="32,5" backgroundColor="#4f74BB" zPosition="1" />\n' % (
                        EIB_object.object_id,
                        EIB_object.getPos([offset[0], offset[1] - iconsize[1]
                                           ]))
                    self[EIB_object.object_id + "_progress"] = Progress()
                    self[EIB_object.object_id + "_progress"].range = 255

            elif EIB_object.object_type in (EIB_THERMO, EIB_TEXT):
                skin += '\t\t\t<widget name="%s" position="%s" size="120,20" font="Regular;14" halign="left" valign="center" foregroundColors="#000000,#0000FF" transparent="1" zPosition="1" />\n' % (
                    EIB_object.object_id, EIB_object.getPos(offset))
                self[EIB_object.object_id] = MultiColorLabel()
        skin += """
		</screen>"""
        if config.eib.debug.value:
            print skin

        self.skin = skin
        Screen.__init__(self, session)
        self.initConfigList()
        ConfigListScreen.__init__(self,
                                  self.list,
                                  session=self.session,
                                  on_change=self.changedEntry)
        self.onChangedEntry = []

        self["actions"] = ActionMap(
            [
                "SetupActions", "OkCancelActions", "ColorActions",
                "DirectionActions"
            ], {
                "up": self.keyUp,
                "upUp": self.keyPass,
                "upRepeated": self.keyUp,
                "down": self.keyDown,
                "downUp": self.keyPass,
                "downRepeated": self.keyDown,
                "leftRepeated": self.keyLeftRepeated,
                "rightRepeated": self.keyRightRepeated,
                "cancel": self.keyCancel,
                "red": self.keyCancel,
                "green": self.keyOk,
                "ok": self.keyOk
            }, -2)

        self.onLayoutFinish.append(self.layoutFinished)
Esempio n. 30
0
    def __init__(self, session, args=0):
        print("[MakeBouquet][__init__] Starting...")
        print("[MakeBouquet][__init__] args", args)
        self.session = session
        Screen.__init__(self, session)
        Screen.setTitle(self, _("MakeBouquet"))
        self.skinName = ["TerrestrialScan"]

        self.path = "/etc/enigma2"
        self.services_dict = {}
        self.tmp_services_dict = {}
        self.namespace_dict = {
        }  # to store namespace when sub network is enabled
        self.logical_channel_number_dict = {}
        self.ignore_visible_service_flag = False  # make this a user override later if found necessary
        self.VIDEO_ALLOWED_TYPES = [1, 4, 5, 17, 22, 24, 25, 27, 135]
        self.AUDIO_ALLOWED_TYPES = [2, 10]
        self.BOUQUET_PREFIX = "userbouquet.TerrestrialScan."
        self.bouquetsIndexFilename = "bouquets.tv"
        self.bouquetFilename = self.BOUQUET_PREFIX + "tv"
        self.bouquetName = _('Terrestrial')
        self.namespace_complete_terrestrial = not (
            config.usage.subnetwork_terrestrial.value if hasattr(
                config.usage, "subnetwork_terrestrial") else True
        )  # config.usage.subnetwork not available in all images

        self.terrestrialXmlFilename = "terrestrial.xml"

        self.frontend = None
        self.rawchannel = None

        self["background"] = Pixmap()
        self["action"] = Label(_("Starting scanner"))
        self["status"] = Label("")
        self["progress"] = ProgressBar()
        self["progress_text"] = Progress()
        self["tuner_text"] = Label("")
        self["Frontend"] = FrontendStatus(
            frontend_source=lambda: self.frontend, update_interval=100)

        self["actions"] = ActionMap(["SetupActions"], {
            "cancel": self.keyCancel,
        }, -2)

        self.selectedNIM = -1
        self.transponders_unique = {}
        self.FTA_only = False
        self.makebouquet = True
        self.makexmlfile = False
        self.lcndescriptor = 0x83
        self.channel_list_id = 0
        if args:
            if "feid" in args:
                self.selectedNIM = args["feid"]
            if "transponders_unique" in args:
                self.transponders_unique = args["transponders_unique"]
            if "FTA_only" in args:
                self.FTA_only = args["FTA_only"]
            if "makebouquet" in args:
                self.makebouquet = args["makebouquet"]
            if "makexmlfile" in args:
                self.makexmlfile = args["makexmlfile"]
            if "lcndescriptor" in args:
                self.lcndescriptor = args["lcndescriptor"]
            if "channel_list_id" in args:
                self.channel_list_id = args["channel_list_id"]

        self.tsidOnidKeys = list(self.transponders_unique.keys())
        self.index = 0
        self.lockTimeout = 50  # 100ms for tick - 5 sec

        self.onClose.append(self.__onClose)
        self.onFirstExecBegin.append(self.firstExec)
Esempio n. 31
0
    def __init__(self,
                 session,
                 job,
                 parent=None,
                 cancelable=True,
                 backgroundable=True,
                 afterEventChangeable=True,
                 afterEvent="nothing"):
        Screen.__init__(self, session, parent)
        Screen.setTitle(self, _("Job View"))
        InfoBarNotifications.__init__(self)
        ConfigListScreen.__init__(self, [])
        self.parent = parent
        self.job = job
        if afterEvent:
            self.job.afterEvent = afterEvent

        self["job_name"] = StaticText(job.name)
        self["job_progress"] = Progress()
        self["job_task"] = StaticText()
        self["summary_job_name"] = StaticText(job.name)
        self["summary_job_progress"] = Progress()
        self["summary_job_task"] = StaticText()
        self["job_status"] = StaticText()

        self.cancelable = cancelable
        self.backgroundable = backgroundable

        self["okActions"] = ActionMap(["SetupActions"], {
            "save": self.ok,
            "ok": self.ok,
        }, -2)

        self["abortActions"] = ActionMap(["SetupActions"], {
            "cancel": self.abort,
        }, -2)

        self["backgroundActions"] = ActionMap(["ColorActions"], {
            "blue": self.background,
        }, -2)

        self["key_green"] = StaticText("")
        self["okActions"].setEnabled(False)

        if self.cancelable:
            self["key_red"] = StaticText(_("Cancel"))
        else:
            self["key_red"] = StaticText("")
            self["abortActions"].setEnabled(False)

        if self.backgroundable:
            self["key_blue"] = StaticText(_("Background"))
        else:
            self["key_blue"] = StaticText("")
            self["backgroundActions"].setEnabled(False)

        self.onShow.append(self.windowShow)
        self.onHide.append(self.windowHide)

        self.settings = ConfigSubsection()
        if SystemInfo["DeepstandbySupport"]:
            shutdownString = _("go to deep standby")
        else:
            shutdownString = _("shut down")
        self.settings.afterEvent = ConfigSelection(choices=[
            ("nothing", _("do nothing")), ("close", _("Close")),
            ("standby", _("go to standby")), ("deepstandby", shutdownString)
        ],
                                                   default=self.job.afterEvent
                                                   or "nothing")
        self.job.afterEvent = self.settings.afterEvent.value
        self.afterEventChangeable = afterEventChangeable
        self.setupList()
        self.state_changed()
Esempio n. 32
0
    def __init__(self, session, destdir="/tmp/"):
        self.skin = NFIDownload.skin
        Screen.__init__(self, session)

        self["job_progressbar"] = Progress()
        self["job_progresslabel"] = StaticText()

        self["infolabel"] = StaticText()
        self["statusbar"] = StaticText()
        self["label_top"] = StaticText()
        self["label_bottom"] = StaticText()
        self["path_bottom"] = StaticText()

        self["key_green"] = StaticText()
        self["key_yellow"] = StaticText()
        self["key_blue"] = StaticText()

        self["key_red"] = StaticText()

        self["feedlist"] = Feedlist([
            0,
            (eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 250, 30, 0,
             RT_HALIGN_LEFT | RT_VALIGN_CENTER, "feed not available")
        ])
        self["destlist"] = FileList(destdir,
                                    showDirectories=True,
                                    showFiles=False)
        self["destlist"].hide()

        self.download_container = eConsoleAppContainer()
        self.nfo = ""
        self.nfofile = ""
        self.feedhtml = ""
        self.focus = None
        self.download = None
        self.box = HardwareInfo().get_device_name()
        self.feed_base = "http://www.dreamboxupdate.com/opendreambox/1.5/%s/images/" % self.box
        self.nfi_filter = ""  # "release" # only show NFIs containing this string, or all if ""
        self.wizard_mode = False

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ColorActions", "DirectionActions",
                "EPGSelectActions"
            ], {
                "cancel": self.closeCB,
                "red": self.closeCB,
                "green": self.nfi_download,
                "yellow": self.switchList,
                "blue": self.askCreateUSBstick,
                "prevBouquet": self.switchList,
                "nextBouquet": self.switchList,
                "ok": self.ok,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "upRepeated": self.up,
                "downRepeated": self.down,
                "down": self.down
            }, -1)

        self.feed_download()
    def __init__(self, session, args=0):
        print("[TerrestrialScan][__init__] Starting...")
        print("[TerrestrialScan][__init__] args", args)
        self.session = session
        Screen.__init__(self, session)
        Screen.setTitle(self, _("TerrestrialScan"))

        self["background"] = Pixmap()
        self["action"] = Label(_("Starting scanner"))
        self["status"] = Label("")
        self["progress"] = ProgressBar()
        self["progress_text"] = Progress()
        self["tuner_text"] = Label("")

        self["actions"] = ActionMap(["SetupActions"], {
            "cancel": self.keyCancel,
        }, -2)

        self.selectedNIM = -1
        self.uhf_vhf = "uhf"
        self.networkid = 0
        self.restrict_to_networkid = False
        self.stabliseTime = 2  # time in seconds for tuner to stablise on tune before taking a signal quality reading
        self.region = None
        if args:
            if "feid" in args:
                self.selectedNIM = args["feid"]
            if "uhf_vhf" in args:
                self.uhf_vhf = args["uhf_vhf"]
            if "networkid" in args:
                self.networkid = args["networkid"]
            if "restrict_to_networkid" in args:
                self.restrict_to_networkid = args["restrict_to_networkid"]
            if "stabliseTime" in args:
                self.stabliseTime = args["stabliseTime"]
            if "region" in args:
                self.region = args["region"]
        self.isT2tuner = False
        self.frontend = None
        self["Frontend"] = FrontendStatus(
            frontend_source=lambda: self.frontend, update_interval=100)
        self.rawchannel = None
        self.session.postScanService = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        self.index = 0
        self.frequency = 0
        self.system = eDVBFrontendParametersTerrestrial.System_DVB_T
        self.lockTimeout = 50  # 100ms for tick - 5 sec
        self.tsidOnidTimeout = 100  # 100ms for tick - 10 sec
        self.snrTimeout = 100  # 100ms for tick - 10 sec
        self.bandwidth = 8  # MHz
        self.scanTransponders = []
        if self.uhf_vhf == "uhf_vhf":
            bandwidth = 7
            for a in range(5, 13):
                for b in (eDVBFrontendParametersTerrestrial.System_DVB_T,
                          eDVBFrontendParametersTerrestrial.System_DVB_T2
                          ):  # system
                    self.scanTransponders.append({
                        "frequency":
                        channel2freq(a, bandwidth),
                        "system":
                        b,
                        "bandwidth":
                        bandwidth
                    })
        if self.uhf_vhf in ("uhf", "uhf_vhf"):
            bandwidth = 8
            for a in range(21, 70):
                for b in (eDVBFrontendParametersTerrestrial.System_DVB_T,
                          eDVBFrontendParametersTerrestrial.System_DVB_T2
                          ):  # system
                    self.scanTransponders.append({
                        "frequency":
                        channel2freq(a, bandwidth),
                        "system":
                        b,
                        "bandwidth":
                        bandwidth
                    })
        if self.uhf_vhf == "australia":
            bandwidth = 7
            base_frequency = 177500000
            for a in range(0, 8) + range(50, 74):
                freq = (base_frequency + (a * bandwidth * 1000000 +
                                          (2000000 if a > 8 else 0)))
                self.scanTransponders.append({
                    "frequency":
                    freq,
                    "system":
                    eDVBFrontendParametersTerrestrial.System_DVB_T,
                    "bandwidth":
                    bandwidth
                })
        if self.uhf_vhf == "xml":
            # frequency 1, inversion 9, bandwidth 2, fechigh 4, feclow 5, modulation 3, transmission 7, guard 6, hierarchy 8, system 10, plp_id 1
            for tp in nimmanager.getTranspondersTerrestrial(self.region):
                # system contains "-1" when both DVB-T and DVB-T2 are to be scanned
                if tp[10] < 1:  # DVB-T
                    self.scanTransponders.append({
                        "frequency":
                        tp[1],
                        "system":
                        eDVBFrontendParametersTerrestrial.System_DVB_T,
                        "bandwidth":
                        tp[2] // 1000000
                    })
                if tp[10] != 0:  # DVB-T2
                    self.scanTransponders.append({
                        "frequency":
                        tp[1],
                        "system":
                        eDVBFrontendParametersTerrestrial.System_DVB_T2,
                        "bandwidth":
                        tp[2] // 1000000
                    })
        self.transponders_found = []
        self.transponders_unique = {}
        self.onClose.append(self.__onClose)
        self.onFirstExecBegin.append(self.firstExec)
Esempio n. 34
0
    def __init__(self, session, args=0):
        print "[ABM-FrequencyFinder][__init__] Starting..."
        print "[ABM-FrequencyFinder][__init__] args", args
        self.session = session
        Screen.__init__(self, session)
        Screen.setTitle(self, _("FrequencyFinder"))
        self.skinName = ["AutoBouquetsMaker"]

        self.frontend = None
        self.rawchannel = None

        self["background"] = Pixmap()
        self["action"] = Label(_("Starting scanner"))
        self["status"] = Label("")
        self["progress"] = ProgressBar()
        self["progress_text"] = Progress()
        self["Frontend"] = FrontendStatus(
            frontend_source=lambda: self.frontend, update_interval=100)

        self["actions"] = ActionMap(["SetupActions"], {
            "cancel": self.keyCancel,
        }, -2)

        self.selectedNIM = -1  # -1 is automatic selection
        self.uhf_vhf = "uhf"
        self.networkid = 0  # this is an onid, not a regional network id
        self.restrict_to_networkid = False
        if args:  # These can be added in ABM config at some time in the future
            if "feid" in args:
                self.selectedNIM = args["feid"]
            if "uhf_vhf" in args:
                self.uhf_vhf = args["uhf_vhf"]
            if "networkid" in args:
                self.networkid = args["networkid"]
            if "restrict_to_networkid" in args:
                self.restrict_to_networkid = args["restrict_to_networkid"]
        self.isT2tuner = False  # unlikely any modern internal terrestrial tuner can't play T2, but some USB tuners can't
        self.session.postScanService = None
        self.index = 0
        self.frequency = 0
        self.system = eDVBFrontendParametersTerrestrial.System_DVB_T
        self.lockTimeout = 50  # 100ms for tick - 5 sec
        self.snrTimeout = 100  # 100ms for tick - 10 sec
        #self.bandwidth = 8 # MHz
        self.scanTransponders = []
        if self.uhf_vhf == "uhf_vhf":
            bandwidth = 7
            for a in range(5, 13):  # channel
                for b in (eDVBFrontendParametersTerrestrial.System_DVB_T,
                          eDVBFrontendParametersTerrestrial.System_DVB_T2
                          ):  # system
                    self.scanTransponders.append({
                        "frequency":
                        channel2freq(a, bandwidth),
                        "system":
                        b,
                        "bandwidth":
                        bandwidth
                    })
        if self.uhf_vhf in ("uhf", "uhf_vhf"):
            bandwidth = 8
            for a in range(21, 70):  # channel
                for b in (eDVBFrontendParametersTerrestrial.System_DVB_T,
                          eDVBFrontendParametersTerrestrial.System_DVB_T2
                          ):  # system
                    self.scanTransponders.append({
                        "frequency":
                        channel2freq(a, bandwidth),
                        "system":
                        b,
                        "bandwidth":
                        bandwidth
                    })
        self.transponders_found = []
        self.transponders_unique = {}
        #		self.custom_dir = os.path.dirname(__file__) + "/../custom"
        #		self.customfile = self.custom_dir + "/CustomTranspondersOverride.xml"
        #		self.removeFileIfExists(self.customfile)
        self.providers_dir = os.path.dirname(__file__) + "/../providers"
        self.providersfile = self.providers_dir + "/terrestrial_finder.xml"
        self.network_name = None
        self.onClose.append(self.__onClose)
        self.onFirstExecBegin.append(self.firstExec)