Skip to content

Commit

Permalink
[BpBlue] More optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ev0-BH committed Dec 3, 2021
1 parent 664bc40 commit 469c618
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion lib/python/Screens/BpBlue.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,41 @@ def __init__(self, session):

self.emlist = []
self["list"] = MenuList(self.emlist)
self["lab1"].setText(_("%d CAMs Installed") % (len(self.emlist)))
self.onShow.append(self.updateBP0)

def updateBP0(self):
self.check_scriptexists()
self.check_camexists()
self.populate_List()
self["list"].setList(self.emlist)
self["lab1"].setText(_("%d CAMs Installed") % (len(self.emlist)))
self.updateBP()

def check_camexists(self):
if path.exists("/usr/camscript"):
cams = listdir("/usr/camscript/")
for fil in cams:
self.ch_ca2(fil)

def ch_ca2(self, script):
if script == "Ncam_Ci.sh":
return
name = script.replace('Ncam_', '').replace('.sh', '')
cams = listdir("/usr/softcams/")
for fil in cams:
if fil == name:
return
vc = False
filein = "/usr/camscript/" + script
f = open(filein,'r')
for line in f.readlines():
if line.find('/usr/softcams/') != -1:
vc = True
break
f.close()
if vc == True:
os_remove(filein)

def check_scriptexists(self):
if path.exists("/usr/softcams"):
cams = listdir("/usr/softcams")
Expand Down

0 comments on commit 469c618

Please sign in to comment.