01 апреля | 2025г. | 18:26:37


АвторТема: Имидж OpenFIX  (Прочитано 147055 раз)

0 Пользователей и 1 Гость смотрят эту тему.

Онлайн yujuАвтор темы

  • Мастер Джедай
  • **
  • Сообщений: 3417
  • Поблагодарили: 13573
  • Уважение: +269
Имидж OpenFIX
« Ответ #135: 09 сентября | 2020г. | 15:14:53 »
0
Этот эпизод
    <!-- Other Info BF -->
    <widget source="session.CurrentService" render="Label" position="1705,853" size="370,33" backgroundColor="secondBG" transparent="1" zPosition="1" font="Regular;28">
      <convert type="VtiTempFan">TempInfo</convert>
    </widget>
    <widget source="session.CurrentService" render="Label" borderWidth="2" position="1200,845" size="195,45" backgroundColor="secondBG" noWrap="1" transparent="1" zPosition="1" foregroundColor="grey" font="Regular;26" valign="center" halign="right">
      <convert type="VtiTempFan">CamName</convert>
    </widget>
вставить в skin_templates.xml
Это файл VtiTempFan.py
# VtiTempFan BF 2020

from Components.Converter.Converter import Converter
from Components.Sensors import sensors
from Components.Element import cached
from enigma import getBoxType
from Poll import Poll
import os

class VtiTempFan(Poll, Converter, object):
    TEMPINFO = 0
    CAMNAME = 1

    def __init__(self, type):
        Poll.__init__(self)
        Converter.__init__(self, type)
        self.type = type
        self.poll_interval = 3000
        self.poll_enabled = True
        if type == 'TempInfo':
            self.type = self.TEMPINFO
        elif type == 'CamName':
            self.type = self.CAMNAME

    @cached
    def getText(self):
        textvalue = ''
        if self.type == self.TEMPINFO:
            textvalue = self.tempfile()
        elif self.type == self.CAMNAME:
            textvalue = self.getCamName()
        return textvalue

    text = property(getText)

    def tempfile(self):
        tempinfo = ''
        mark = str('\xc2\xb0')
        temperature = ''

        if os.path.isfile('/proc/hisi/msp/pm_cpu'):
            try:
                tempinfo = search('temperature = (\d+) degree', open('/proc/hisi/msp/pm_cpu').read()).group(1)
            except:
                pass
        if temperature > 0:
                tempinfo = 'CPU: ' + str(temperature) + mark + 'C'
        return tempinfo

    def getCamName(self):
        if os.path.exists('/etc/init.d/softcam'):
            try:
                for line in open('/etc/init.d/softcam'):
                    line = line.lower()
                    if 'wicardd' in line:
                        return 'WiCard'
                    if 'incubus' in line:
                        return 'Incubus'
                    if 'gbox' in line:
                        return 'Gbox'
                    if 'mbox' in line:
                        return 'Mbox'
                    if 'cccam' in line:
                        return 'CCcam'
                    if 'oscam-emu' in line:
                        return 'oscam-emu'
                    if 'oscam' in line:
                        return 'OSCam'
                    if 'camd3' in line:
                        if 'mgcamd' not in line:
                            return 'Camd3'
                    else:
                        if 'mgcamd' in line:
                            return 'Mgcamd'
                        if 'gcam' in line:
                            if 'mgcamd' not in line:
                                return 'GCam'
                        else:
                            if 'ncam' in line:
                                return 'NCam'
                            if 'common' in line:
                                return 'CI'
                            if 'interface' in line:
                                return 'CI'

            except:
                pass

        return ''

    def changed(self, what):
        if what[0] == self.CHANGED_POLL:
            Converter.changed(self, what)
В результате:
Спойлер   :
Скрытый текст
Для просмотра нужно иметь не менее 3-х сообщений
или Оформить подписку



 



X

Добро пожаловать!

Мы заметили, что у Вас установлено расширение AdBlock или ему подобное. Пожалуйста добавьте наш Клуб в белый список, внесите этим посильную лепту в его развитие. Спасибо!