Skip to content

Commit

Permalink
Merge branch 'Developer' into Python3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Ev0-BH committed Jan 5, 2024
2 parents 015aaab + 47e59df commit f2987d7
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 8 deletions.
71 changes: 71 additions & 0 deletions lib/python/Components/Converter/CryptoInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from Components.Converter.Poll import Poll
from Components.Element import cached
from Components.config import config
from enigma import iServiceInformation
from Tools.GetEcmInfo import GetEcmInfo


Expand Down Expand Up @@ -30,6 +31,76 @@ def getText(self):
self.visible = True
if self.type == "VerboseInfo":
data = self.ecmdata.getEcmData()[0]
elif self.type == "FullInfo":
textvalue = ""
server = ""
service = self.source.service
if service:
info = service and service.info()
if info:
try:
if info.getInfoObject(iServiceInformation.sCAIDs):
ecm_info = self.ecmdata.getInfoRaw()
if ecm_info:
# caid
caid = "%0.4X" % int(ecm_info.get('caid', ecm_info.get('CAID', '0')), 16)
#pid
pid = "%0.4X" % int(ecm_info.get('pid', ecm_info.get('ECM PID', '0')), 16)
# oscam
prov = "%0.6X" % int(ecm_info.get('provid', ecm_info.get('prov', ecm_info.get('Provider', '0'))), 16)

if ecm_info.get("ecm time", "").find("msec") > -1:
ecm_time = ecm_info.get("ecm time", "")
else:
ecm_time = ecm_info.get("ecm time", "").replace(".", "").lstrip("0") + " msec"

#from (oscam)
from_item = ecm_info.get("from", "")
from_splitted = from_item.split(":")
#protocol
protocol = ecm_info.get("protocol", "")
# server
server = from_splitted[0].strip()
#port
port = from_splitted[1].strip() if len(from_splitted) > 1 else ""
# source
if from_splitted[0].strip() == "local":
source = "sci"
else:
source = "net"
# hops
hops = ecm_info.get("hops", "")
#system
system = ecm_info.get("system", "")
#provider
provider = ecm_info.get("provider", "")
# reader
reader = ecm_info.get("reader", "")
if source == "emu":
textvalue = "%s - %s (Caid: %s, Prov: %s,)" % (source, caid, caid, prov)
#new oscam ecm.info with port parametr
elif reader != "" and source == "net" and port != "":
textvalue = "%s - Caid: %s, Prov: %s, Reader: %s, %s (%s:%s) - %s" % (source, caid, prov, reader, protocol, server, port, ecm_time.replace('msec', 'ms'))
elif reader != "" and source == "net":
textvalue = "%s - Caid: %s, Prov: %s, Reader: %s, %s (%s) - %s" % (source, caid, prov, reader, protocol, server, ecm_time.replace('msec', 'ms'))
elif reader != "" and source != "net":
textvalue = "%s - Caid: %s, Prov: %s, Reader: %s, %s (local) - %s" % (source, caid, prov, reader, protocol, ecm_time.replace('msec', 'ms'))
elif server == "" and port == "" and protocol != "":
textvalue = "%s - Caid: %s, Prov: %s, %s - %s" % (source, caid, prov, protocol, ecm_time.replace('msec', 'ms'))
elif server == "" and port == "" and protocol == "":
textvalue = "%s - Caid: %s - %s, Prov: %s" % (source, prov, caid, ecm_time.replace('msec', 'ms'))
else:
try:
textvalue = "%s - Caid: %s, Prov: %s, %s (%s:%s) - %s" % (source, caid, prov, protocol, server, port, ecm_time.replace('msec', 'ms'))
except:
pass
else:
textvalue = "No parse cannot Emu"
else:
textvalue = "Free to Air"
except:
pass
return textvalue
else:
data = self.ecmdata.getInfo(self.type)
return data
Expand Down
10 changes: 3 additions & 7 deletions lib/python/Components/SystemInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from Tools.Directories import fileCheck, fileExists, fileHas, pathExists, resolveFilename, SCOPE_LIBDIR, SCOPE_SKIN, fileReadLines
from Tools.HardwareInfo import HardwareInfo

SystemInfo = {}


class BoxInformation:
def __init__(self, root=""):
Expand All @@ -31,8 +29,6 @@ def __init__(self, root=""):
self.setItem(item, self.processValue(value), immutable=True)
if self.boxInfo["checksumerror"]:
print("[BoxInfo] Data integrity of %s could not be verified." % file)
# else:
# print("[SystemInfo] Enigma information file data loaded into BoxInfo.")
else:
print("[BoxInfo] ERROR: %s is not available! The system is unlikely to boot or operate correctly." % file)

Expand Down Expand Up @@ -60,8 +56,6 @@ def getItemsList(self):
def getItem(self, item, default=None):
if item in self.boxInfo:
return self.boxInfo[item]
elif item in SystemInfo:
return SystemInfo[item]
return default

def setItem(self, item, value, immutable=False, forceOverride=False):
Expand All @@ -71,7 +65,6 @@ def setItem(self, item, value, immutable=False, forceOverride=False):
if immutable and item not in self.immutableList:
self.immutableList.append(item)
self.boxInfo[item] = value
SystemInfo[item] = value
return True

def deleteItem(self, item, forceOverride=False):
Expand All @@ -86,6 +79,9 @@ def deleteItem(self, item, forceOverride=False):
BoxInfo = BoxInformation()


SystemInfo = BoxInfo.boxInfo


ARCHITECTURE = BoxInfo.getItem("architecture")
BRAND = BoxInfo.getItem("brand")
MODEL = BoxInfo.getItem("model")
Expand Down
4 changes: 4 additions & 0 deletions lib/python/Tools/GetEcmInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def getInfo(self, member, ifempty=''):
self.pollEcmData()
return str(info.get(member, ifempty))

def getInfoRaw(self):
self.pollEcmData()
return info

def getText(self):
global ecm
try:
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Tools/Multiboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def createInfo(slot, imagedir="/"):
BuildVer = BoxInfo.getItem("imagebuild")
BuildDate = VerDate(imagedir)
BuildDev = str(BoxInfo.getItem("imagedevbuild")).zfill(3) if BuildType == "developer" else ""
return "%s %s %s %s %s (%s)" % (Creator, BuildImgVersion, BuildType, BuildVer, BuildDev, BuildDate)
return " ".join([x for x in (Creator, BuildImgVersion, BuildType, BuildVer, BuildDev, "(%s)" % BuildDate) if x])


def VerDate(imagedir):
Expand Down

0 comments on commit f2987d7

Please sign in to comment.