def getText(self):
        service = self.source.service
        info = service and service.info()
        if not info:
            return ''
        else:
            camd = None
            if fileExists('/tmp/cam.info'):
                try:
                    camdlist = open('/tmp/cam.info', 'r')
                except:
                    return

            elif fileExists('/etc/clist.list'):
                try:
                    camdlist = open('/etc/clist.list', 'r')
                except:
                    return

            elif fileExists('/etc/demonisat/defaultcam'):
                try:
                    f = open('/etc/demonisat/defaultcam')
                    camd = f.read()
                    f.close()
                    return camd.split(':')[0]
                except:
                    return

            elif fileExists('/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so'):
                try:
                    from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                    from Plugins.Bp.geminimain.lib import libgeminimain
                    camdl = libgeminimain.getPyList(GETCAMDLIST)
                    camd = None
                    for x in camdl:
                        if x[1] == 1:
                            camd = x[2]

                    return camd
                except:
                    return

            else:
                camdlist = None
            if camdlist is not None:
                for current in camdlist:
                    camd = current

                camdlist.close()
                return camd
            if camd is not None:
                return camd
            return ''
            return
    def getText(self):
        service = self.source.service
        info = service and service.info()
        if not info:
            return ""
        camd = None

        # OoZooN
        if fileExists("/tmp/cam.info"):
            try:
                camdlist = open("/tmp/cam.info", "r")
            except:
                return None

        # Merlin2
        elif fileExists("/etc/clist.list"):
            try:
                camdlist = open("/etc/clist.list", "r")
            except:
                return None

        # GP3
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"
        ):
            try:
                from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                from Plugins.Bp.geminimain.lib import libgeminimain

                camdl = libgeminimain.getPyList(GETCAMDLIST)
                camd = None
                for x in camdl:
                    if x[1] == 1:
                        camd = x[2]
                return camd
            except:
                return None

        else:
            camdlist = None

        if camdlist is not None:
            for current in camdlist:
                camd = current
            camdlist.close()
            return camd
        elif camd is not None:
            return camd
        else:
            return ""
Exemple #3
0
	def getText(self):
		service = self.source.service
		info = service and service.info()
		if not info:
		   return ""
		camd = None

		# OoZooN
		if fileExists("/tmp/cam.info"):
			try:
				camdlist = open("/tmp/cam.info", "r")
			except:
				return None

		# Merlin2
		elif fileExists("/etc/clist.list"):
			try:
		   		camdlist = open("/etc/clist.list", "r")
		   	except:
				return None

		# GP3
		elif fileExists("/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"):
			try:
				from Plugins.Bp.geminimain.plugin import GETCAMDLIST
				from Plugins.Bp.geminimain.lib import libgeminimain

				camdl = libgeminimain.getPyList(GETCAMDLIST)
				camd = None
				for x in camdl:
					if x[1] == 1:
						camd = x[2]
				return camd
		   	except:
				return None

		else:
			camdlist = None

		if camdlist is not None:
			for current in camdlist:
				camd = current
			camdlist.close()
			return camd
		elif camd is not None:
			return camd
		else:
			return ""
Exemple #4
0
    def getText(self):
        service = self.source.service
        info = service and service.info()
        camd = ""
        serlist = None
        camdlist = None
        nameemu = []
        nameser = []
        if not info:
            return ""
        # Pli
        if fileExists("/etc/init.d/softcam") or fileExists(
                "/etc/init.d/cardserver"):
            try:
                for line in open("/etc/init.d/softcam"):
                    if line.find("echo") > -1:
                        nameemu.append(line)
                camdlist = "%s" % nameemu[1].split('"')[1]
            except:
                pass
            try:
                for line in open("/etc/init.d/cardserver"):
                    if line.find("echo") > -1:
                        nameser.append(line)
                serlist = "%s" % nameser[1].split('"')[1]
            except:
                pass
            if serlist is None:
                serlist = ""
            elif camdlist is None:
                camdlist = ""
            elif serlist is None and camdlist is None:
                serlist = ""
                camdlist = ""
            return ("%s %s" % (serlist, camdlist))
        # TS-Panel
        if fileExists("/etc/startcam.sh"):
            try:
                for line in open("/etc/startcam.sh"):
                    if line.find("script") > -1:
                        return "%s" % line.split("/")[-1].split()[0][:-3]
            except:
                camdlist = None
        # BlackHole OE1.6
        elif fileExists("/etc/CurrentDelCamName"):
            try:
                camdlist = open("/etc/CurrentDelCamName", "r")
            except:
                return None
        # DE-OpenBlackHole
        elif fileExists("/etc/BhFpConf"):
            try:
                camdlist = open("/etc/BhCamConf", "r")
            except:
                return None
        #PKT
        elif fileExists(
                "//usr/lib/enigma2/python/Plugins/Extensions/PKT/plugin.pyo"):
            if config.plugins.emuman.cam.value:
                return config.plugins.emuman.cam.value
        #HDMU
        elif fileExists("/etc/.emustart") and fileExists("/etc/image-version"):
            try:
                for line in open("/etc/.emustart"):
                    return line.split()[0].split('/')[-1]
            except:
                return None

        # AAF & ATV & VTI
        elif fileExists(
                "/etc/image-version") and not fileExists("/etc/.emustart"):
            emu = ""
            server = ""
            for line in open("/etc/image-version"):
                if "=AAF" in line or "=openATV" in line:
                    if config.softcam.actCam.value:
                        emu = config.softcam.actCam.value
                    if config.softcam.actCam2.value:
                        server = config.softcam.actCam2.value
                        if config.softcam.actCam2.value == "no CAM 2 active":
                            server = ""
                elif "=vuplus" in line:
                    if fileExists("/tmp/.emu.info"):
                        for line in open("/tmp/.emu.info"):
                            emu = line.strip('\n')
                # BlackHole OE2.0
                elif "version=" in line and fileExists(
                        "/etc/CurrentBhCamName"):
                    emu = open("/etc/CurrentBhCamName").read()
            return "%s %s" % (emu, server)
        # Domica
        elif fileExists("/etc/active_emu.list"):
            try:
                camdlist = open("/etc/active_emu.list", "r")
            except:
                return None
        # Egami
        elif fileExists("/tmp/egami.inf", "r"):
            lines = open("/tmp/egami.inf", "r").readlines()
            for line in lines:
                item = line.split(":", 1)
                if item[0] == "Current emulator":
                    return item[1].strip()
        #  GlassSysUtil
        elif fileExists("/tmp/ucm_cam.info"):
            return open("/tmp/ucm_cam.info").read()
        # OoZooN
        elif fileExists("/tmp/cam.info"):
            try:
                camdlist = open("/tmp/cam.info", "r")
            except:
                return None
        # Dream Elit
        elif fileExists("/usr/bin/emuactive"):
            try:
                camdlist = open("/usr/bin/emuactive", "r")
            except:
                return None
        # Merlin2
        elif fileExists("/etc/clist.list"):
            try:
                camdlist = open("/etc/clist.list", "r")
            except:
                return None
        # GP3
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"
        ):
            try:
                from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                from Plugins.Bp.geminimain.lib import libgeminimain
                camdl = libgeminimain.getPyList(GETCAMDLIST)
                cam = None
                for x in camdl:
                    if x[1] == 1:
                        cam = x[2]
                return cam
            except:
                return None
        # Unknown emu
        else:
            return None

        if serlist is not None:
            try:
                cardserver = ""
                for current in serlist.readlines():
                    cardserver = current
                serlist.close()
            except:
                pass
        else:
            cardserver = "NA"

        if camdlist is not None:
            try:
                emu = ""
                for current in camdlist.readlines():
                    emu = current
                camdlist.close()
            except:
                pass
        else:
            emu = "NA"

        return "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
Exemple #5
0
    def getText(self):
        service = self.source.service
        info = service and service.info()
        if not service:
            return None
        camd = ""
        serlist = None
        camdlist = None
        nameemu = []
        nameser = []
        if not info:
            return ""

            # LbPanel
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/SystemPlugins/LBpanel/plugin.pyo"
        ):
            if config.plugins.lbpanel.activeemu.value != "none":
                valor = config.plugins.lbpanel.activeemu.value.replace(
                    'camemu.', '')
                return valor
            else:
                return None
        # TS-Panel
        elif fileExists("/etc/startcam.sh"):
            try:
                for line in open("/etc/startcam.sh"):
                    if line.find("script") > -1:
                        return "%s" % line.split("/")[-1].split()[0][:-3]
            except:
                camdlist = None
        # domica 8120
        elif fileExists("/etc/init.d/cam"):
            if config.plugins.emuman.cam.value:
                return config.plugins.emuman.cam.value
        #PKT
        elif fileExists(
                "//usr/lib/enigma2/python/Plugins/Extensions/PKT/plugin.pyo"):
            if config.plugins.emuman.cam.value:
                return config.plugins.emuman.cam.value
        #HDMU
        elif fileExists("/etc/.emustart") and fileExists("/etc/image-version"):
            try:
                for line in open("/etc/.emustart"):
                    return line.split()[0].split('/')[-1]
            except:
                return None

        # AAF & ATV & VTI
        elif fileExists(
                "/etc/image-version") and not fileExists("/etc/.emustart"):
            emu = ""
            server = ""
            for line in open("/etc/image-version"):
                if line.find("=AAF") > -1 or line.find(
                        "=openPlus") > -1 or line.find("=openATV") > -1:
                    if config.softcam.actCam.value:
                        emu = config.softcam.actCam.value
                        if "Oscam" in config.softcam.actCam.value:
                            if fileExists("/tmp/.oscam/oscam.version"):
                                try:
                                    for line in open(
                                            "/tmp/.oscam/oscam.version"):
                                        if line.find("Version") > -1:
                                            item = line.split(":", 1)
                                            emu = item[1].strip()
                                except:
                                    pass
                if config.softcam.actCam2.value:
                    server = config.softcam.actCam2.value
                    if config.softcam.actCam2.value == "no CAM 2 active" or config.softcam.actCam2.value == "Keine CAM 2 aktiv":
                        server = ""
                elif line.find("=vuplus") > -1:
                    if fileExists("/tmp/.emu.info"):
                        for line in open("/tmp/.emu.info"):
                            emu = line.strip('\n')
            return "%s - %s" % (emu, server)
        # BlackHole
        elif fileExists("/etc/CurrentBhCamName"):
            try:
                camdlist = open("/etc/CurrentBhCamName", "r")
            except:
                return None
        # Domica
        elif fileExists("/etc/active_emu.list"):
            try:
                camdlist = open("/etc/active_emu.list", "r")
            except:
                return None
        # Egami
        elif fileExists("/tmp/egami.inf", "r"):
            for line in open("/tmp/egami.inf"):
                item = line.split(":", 1)
                if item[0] == "Current emulator":
                    return item[1].strip()
        #Pli
        elif fileExists("/etc/init.d/softcam") or fileExists(
                "/etc/init.d/cardserver"):
            try:
                for line in open("/etc/init.d/softcam"):
                    if line.find("echo") > -1:
                        nameemu.append(line)
                camdlist = "%s" % nameemu[1].split('"')[1]
            except:
                pass
            try:
                for line in open("/etc/init.d/cardserver"):
                    if line.find("echo") > -1:
                        nameser.append(line)
                serlist = "%s" % nameser[1].split('"')[1]
            except:
                pass
            if serlist is None:
                serlist = ""
            elif camdlist is None:
                camdlist = ""
            elif serlist is None and camdlist is None:
                serlist = ""
                camdlist = ""
            return ("%s %s" % (serlist, camdlist))
        # OoZooN
        elif fileExists("/tmp/cam.info"):
            try:
                camdlist = open("/tmp/cam.info", "r")
            except:
                return None
        # Merlin2
        elif fileExists("/etc/clist.list"):
            try:
                camdlist = open("/etc/clist.list", "r")
            except:
                return None
        # GP3
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"
        ):
            try:
                from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                from Plugins.Bp.geminimain.lib import libgeminimain
                camdl = libgeminimain.getPyList(GETCAMDLIST)
                cam = None
                for x in camdl:
                    if x[1] == 1:
                        cam = x[2]
                return cam
            except:
                return None
        else:
            return None

        if serlist is not None:
            try:
                cardserver = ""
                for current in serlist.readlines():
                    cardserver = current
                serlist.close()
            except:
                pass
        else:
            cardserver = " "

        if camdlist is not None:
            try:
                emu = ""
                for current in camdlist.readlines():
                    emu = current
                camdlist.close()
            except:
                pass
        else:
            emu = " "

        return "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
    def getText(self):
        service = self.source.service
        info = service and service.info()
        camd = ""
        serlist = None
        camdlist = None
        if not info:
            return ""
        # TS-Panel
        if fileExists("/etc/startcam.sh"):
            try:
                for line in open("/etc/startcam.sh"):
                    if line.find("script") > -1:
                        return "%s" % line.split("/")[-1].split()[0][:-3]
            except:
                camdlist = None
        # VTI
        elif fileExists("/tmp/.emu.info"):
            try:
                camdlist = open("/tmp/.emu.info", "r")
            except:
                return None
        # BlackHole
        elif fileExists("/etc/CurrentBhCamName"):
            try:
                camdlist = open("/etc/CurrentBhCamName", "r")
            except:
                return None
        # Domica
        elif fileExists("/etc/active_emu.list"):
            try:
                camdlist = open("/etc/active_emu.list", "r")
            except:
                return None
        # Egami
        elif fileExists("/tmp/egami.inf", "r"):
            lines = open("/tmp/egami.inf", "r").readlines()
            for line in lines:
                item = line.split(":", 1)
                if item[0] == "Current emulator":
                    return item[1].strip()
        #Pli
        elif fileExists("/etc/init.d/softcam") or fileExists(
                "/etc/init.d/cardserver"):
            try:
                camdlist = os.popen("/etc/init.d/softcam info")
            except:
                pass
            try:
                serlist = os.popen("/etc/init.d/cardserver info")
            except:
                pass

        # OoZooN
        elif fileExists("/tmp/cam.info"):
            try:
                camdlist = open("/tmp/cam.info", "r")
            except:
                return None
        # Merlin2
        elif fileExists("/etc/clist.list"):
            try:
                camdlist = open("/etc/clist.list", "r")
            except:
                return None
        # GP3
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"
        ):
            try:
                from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                from Plugins.Bp.geminimain.lib import libgeminimain
                camdl = libgeminimain.getPyList(GETCAMDLIST)
                cam = None
                for x in camdl:
                    if x[1] == 1:
                        cam = x[2]
                return cam
            except:
                return None
        # Unknown emu
        else:
            return None

        if serlist is not None:
            try:
                cardserver = ""
                for current in serlist.readlines():
                    cardserver = current
                serlist.close()
            except:
                pass
        else:
            cardserver = " "

        if camdlist is not None:
            try:
                emu = ""
                for current in camdlist.readlines():
                    emu = current
                camdlist.close()
            except:
                pass
        else:
            emu = " "

        return "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
Exemple #7
0
	def getText(self):
		service = self.source.service
		info = service and service.info()
		if not service:
			return None
		camd = ""
		serlist = None
		camdlist = None
		nameemu = []
		nameser = []
		if not info:
			return ""
		# Alternative SoftCam Manager 
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/AlternativeSoftCamManager/plugin.py"): 
			if config.plugins.AltSoftcam.actcam.value != "none": 
				return config.plugins.AltSoftcam.actcam.value 
			else: 
				return None
		# TS-Panel
		elif fileExists("/etc/startcam.sh"):
			try:
				for line in open("/etc/startcam.sh"):
					if line.find("script") > -1:
						return "%s" % line.split("/")[-1].split()[0][:-3]
			except:
				camdlist = None
		# domica 8120
		elif fileExists("/etc/init.d/cam"):
			if config.plugins.emuman.cam.value: 
				return config.plugins.emuman.cam.value
		#PKT
		elif fileExists("//usr/lib/enigma2/python/Plugins/Extensions/PKT/plugin.pyo"):
			if config.plugins.emuman.cam.value: 
				return config.plugins.emuman.cam.value
		#HDMU
		elif fileExists("/etc/.emustart") and fileExists("/etc/image-version"):
			try:
				for line in open("/etc/.emustart"):
					return line.split()[0].split('/')[-1]
			except:
				return None
	
		# AAF & ATV & VTI 
		elif fileExists("/etc/image-version") and not fileExists("/etc/.emustart"):
			emu = ""
			server = ""
			for line in open("/etc/image-version"):
				if line.find("=AAF") > -1 or line.find("=openATV") > -1:
					if config.softcam.actCam.value: 
						emu = config.softcam.actCam.value
					if config.softcam.actCam2.value: 
						server = config.softcam.actCam2.value
						if config.softcam.actCam2.value == "no CAM 2 active":
							server = ""
				elif line.find("=vuplus") > -1:
					if fileExists("/tmp/.emu.info"):
						for line in open("/tmp/.emu.info"):
							emu = line.strip('\n')
			return "%s %s" % (emu, server)
		# BlackHole	
		elif fileExists("/etc/CurrentBhCamName"):
			try:
				camdlist = open("/etc/CurrentBhCamName", "r")
			except:
				return None
		# Domica	
		elif fileExists("/etc/active_emu.list"):
			try:
				camdlist = open("/etc/active_emu.list", "r")
			except:
				return None
		# Egami	
		elif fileExists("/tmp/egami.inf","r"):
			for line in open("/tmp/egami.inf"):
				item = line.split(":",1)
				if item[0] == "Current emulator":
					return item[1].strip()
		#Pli
		elif fileExists("/etc/init.d/softcam") or fileExists("/etc/init.d/cardserver"):
			try:
				for line in open("/etc/init.d/softcam"):
					if line.find("echo") > -1:
						nameemu.append(line)
				camdlist = "%s" % nameemu[1].split('"')[1]
			except:
				pass
			try:
				for line in open("/etc/init.d/cardserver"):
					if line.find("echo") > -1:
						nameser.append(line)
				serlist = "%s" % nameser[1].split('"')[1]
			except:
				pass
			if serlist is None:
				serlist = ""
			elif camdlist is None:
				camdlist = ""
			elif serlist is None and camdlist is None:
				serlist = ""
				camdlist = ""
			return ("%s %s" % (serlist, camdlist))
		# OoZooN
		elif fileExists("/tmp/cam.info"):
			try:
				camdlist = open("/tmp/cam.info", "r")
			except:
				return None
		# Merlin2	
		elif fileExists("/etc/clist.list"):
			try:
				camdlist = open("/etc/clist.list", "r")
			except:
				return None
		# GP3
		elif fileExists("/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"):
			try:
				from Plugins.Bp.geminimain.plugin import GETCAMDLIST
				from Plugins.Bp.geminimain.lib import libgeminimain
				camdl = libgeminimain.getPyList(GETCAMDLIST)
				cam = None
				for x in camdl:
					if x[1] == 1:
						cam = x[2] 
				return cam
		   	except:
				return None
		else:
			return None
			
		if serlist is not None:
			try:
				cardserver = ""
				for current in serlist.readlines():
					cardserver = current
				serlist.close()
			except:
				pass
		else:
			cardserver = " "

		if camdlist is not None:
			try:
				emu = ""
				for current in camdlist.readlines():
					emu = current
				camdlist.close()
			except:
				pass
		else:
			emu = " "
			
		return "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
Exemple #8
0
    def getText(self):
        service = self.source.service
        info = service and service.info()
        camd = ''
        camdlist = None
        serlist = None
        if not info:
            return ''
        else:
            if fileExists('/tmp/.emu.info'):
                try:
                    camdlist = open('/tmp/.emu.info', 'r')
                except:
                    return

            elif fileExists('/etc/CurrentBhCamName'):
                try:
                    camdlist = open('/etc/CurrentBhCamName', 'r')
                except:
                    return

            elif fileExists('/etc/active_emu.list'):
                try:
                    camdlist = open('/etc/.active_emu.list', 'r')
                except:
                    return

            elif fileExists('/tmp/egami.inf', 'r'):
                lines = open('/tmp/egami.inf', 'r').readlines()
                for line in lines:
                    item = line.split(':', 1)
                    if item[0] == 'Current emulator':
                        return item[1].strip()

            elif fileExists('/etc/init.d/softcam') or fileExists(
                    '/etc/init.d/cardserver') or fileExists(
                        '/etc/.ActiveCamd'):
                try:
                    camdlist = os.popen('/etc/init.d/softcam info')
                except:
                    pass

                try:
                    serlist = os.popen('/etc/init.d/cardserver info')
                except:
                    pass

                try:
                    camdlist = open('/etc/.ActiveCamd', 'r')
                except:
                    pass

            elif fileExists('/tmp/cam.info'):
                try:
                    camdlist = open('/tmp/cam.info', 'r')
                except:
                    return

            elif fileExists('/etc/clist.list'):
                try:
                    camdlist = open('/etc/clist.list', 'r')
                except:
                    return

            elif fileExists(
                    '/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so'
            ):
                try:
                    from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                    from Plugins.Bp.geminimain.lib import libgeminimain
                    camdl = libgeminimain.getPyList(GETCAMDLIST)
                    cam = None
                    for x in camdl:
                        if x[1] == 1:
                            cam = x[2]

                    return cam
                except:
                    return

            else:
                return
            if serlist is not None:
                try:
                    cardserver = ''
                    for current in serlist.readlines():
                        cardserver = current

                    serlist.close()
                except:
                    pass

            else:
                cardserver = 'NA'
            if camdlist is not None:
                try:
                    emu = ''
                    for current in camdlist.readlines():
                        emu = current

                    camdlist.close()
                except:
                    pass

            else:
                emu = 'NA'
            return '%s %s' % (cardserver.split('\n')[0], emu.split('\n')[0])
Exemple #9
0
	def getText(self):
		service = self.source.service
		info = service and service.info()
		camd = ""
		camdlist = None
		serlist = None
		if not info:
			return ""
		# VTI 	
		if fileExists("/tmp/.emu.info"):
			try:
				camdlist = open("/tmp/.emu.info", "r")
			except:
				return None
		# BlackHole	
		elif fileExists("/etc/CurrentBhCamName"):
			try:
				camdlist = open("/etc/CurrentBhCamName", "r")
			except:
				return None
		# Domica	
		elif fileExists("/etc/active_emu.list"):
			try:
				camdlist = open("/etc/active_emu.list", "r")
			except:
				return None
		# Egami	
		elif fileExists("/tmp/egami.inf","r"):
			lines = open("/tmp/egami.inf", "r").readlines()
			for line in lines:
				item = line.split(":",1)
				if item[0] == "Current emulator":
					return item[1].strip()
		#Pli
		elif fileExists("/etc/init.d/softcam") or fileExists("/etc/init.d/cardserver"):
			try:
				camdlist = os.popen("/etc/init.d/softcam info")
			except:
				pass
			try:
				serlist = os.popen("/etc/init.d/cardserver info")
			except:
				pass
			
		# OoZooN
		elif fileExists("/tmp/cam.info"):
			try:
				camdlist = open("/tmp/cam.info", "r")
			except:
				return None
		# Merlin2	
		elif fileExists("/etc/clist.list"):
			try:
		   		camdlist = open("/etc/clist.list", "r")
		   	except:
				return None
		# GP3
		elif fileExists("/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"):
			try:
				from Plugins.Bp.geminimain.plugin import GETCAMDLIST
				from Plugins.Bp.geminimain.lib import libgeminimain
				camdl = libgeminimain.getPyList(GETCAMDLIST)
				cam = None
				for x in camdl:
					if x[1] == 1:
						cam = x[2] 
				return cam
		   	except:
				return None
		# Unknown emu
		else:
			return None
			
		if serlist is not None:
			try:
				cardserver = ""
				for current in serlist.readlines():
					cardserver = current
				serlist.close()
			except:
				pass
		else:
			cardserver = "NA"

		if camdlist is not None:
			try:
				emu = ""
				for current in camdlist.readlines():
					emu = current
				camdlist.close()
			except:
				pass
		else:
			emu = "NA"
			
		return "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
Exemple #10
0
	def getText(self):
		ecminfo = ""
		caidvalue = ""
		service = self.source.service
		info = service and service.info()
		if not info:
			return ""
			
		if self.type == self.vtype:
			try:
				return ("MPEG2", "MPEG4", "MPEG1", "MPEG4-II", "VC1", "VC1-SM", "")[info.getInfo(iServiceInformation.sVideoType)]
			except: 
				return " "
			
		elif self.type == self.bitrate:
			audio = service.audioTracks()
			yres = info.getInfo(iServiceInformation.sVideoHeight)
			mode = ("i", "p", "")[info.getInfo(iServiceInformation.sProgressive)]
			xres = info.getInfo(iServiceInformation.sVideoWidth)
			try:
				return "%sx%s(%s) VIDEO %s: %d kbit/s  AUDIO %s: %d kbit/s" % (str(xres), str(yres) + mode, self.getServiceInfoString(info, iServiceInformation.sFrameRate, lambda x: "%d" % ((x+500)/1000)), ("MPEG2", "MPEG4", "MPEG1", "MPEG4-II", "VC1", "VC1-SM", "")[info.getInfo(iServiceInformation.sVideoType)], self.video,str(audio.getTrackInfo(audio.getCurrentTrack()).getDescription()), self.audio)
			except: 
				return " "
				
		elif self.type == self.txtcaid:
			caidvalue = "%s" % self.systemTxtCaids.get(self.caidstr()[:2]) 
			if caidvalue != "None":
				return caidvalue
			else:
				return " "
			
		elif self.type == self.ecmfile:
			if self.getServiceInfoString(info, iServiceInformation.sCAIDs):
				try:
					ecmfiles = open("/tmp/ecm.info", "r")
					for line in ecmfiles:
						if line.find("caid:") > -1 or line.find("provider:") > -1 or line.find("provid:") > -1 or line.find("pid:") > -1 or line.find("hops:") > -1  or line.find("system:") > -1 or line.find("address:") > -1 or line.find("using:") > -1 or line.find("ecm time:") > -1:
							line = line.replace(' ',"").replace(":",": ")
						if line.find("caid:") > -1 or line.find("pid:") > -1 or line.find("reader:") > -1 or line.find("from:") > -1 or line.find("hops:") > -1  or line.find("system:") > -1 or line.find("Service:") > -1 or line.find("CAID:") > -1 or line.find("Provider:") > -1:
							line = line.strip('\n') + "  "
						if line.find("Signature") > -1:
							line = ""
						if line.find("=") > -1:
							line = line.lstrip('=').replace('======', "").replace('\n', "").rstrip() + ', '
						if line.find("ecmtime:") > -1:
							line = line.replace("ecmtime:", "ecm time:")
						if line.find("response time:") > -1:
							line = line.replace("response time:", "ecm time:").replace("decoded by", "by")
						if not line.startswith('\n'):
							if line.find('pkey:') > -1:
								line = '\n' + line + '\n'
							ecminfo += line
					ecmfiles.close()
				except:
					pass
###############################################################################
		elif self.type == self.activecaid:
			caidvalue = self.caidstr()
			return caidvalue
					
		elif self.type == self.pids:
			try:
				return "SID: %0.4X  VPID: %0.4X  APID: %0.4X  PRCPID: %0.4X  TSID: %0.4X  ONID: %0.4X" % (int(self.getServiceInfoString(info, iServiceInformation.sSID)), int(self.getServiceInfoString(info, iServiceInformation.sVideoPID)), int(self.getServiceInfoString(info, iServiceInformation.sAudioPID)), int(self.getServiceInfoString(info, iServiceInformation.sPCRPID)), int(self.getServiceInfoString(info, iServiceInformation.sTSID)), int(self.getServiceInfoString(info, iServiceInformation.sONID)))
			except:
				try:
					return "SID: %0.4X  APID: %0.4X  PRCPID: %0.4X  TSID: %0.4X  ONID: %0.4X" % (int(self.getServiceInfoString(info, iServiceInformation.sSID)), int(self.getServiceInfoString(info, iServiceInformation.sAudioPID)), int(self.getServiceInfoString(info, iServiceInformation.sPCRPID)), int(self.getServiceInfoString(info, iServiceInformation.sTSID)), int(self.getServiceInfoString(info, iServiceInformation.sONID)))
				except:
					return " "
			
		elif self.type == self.caids:
			try:
				ecminfo = self.getServiceInfoString(info, iServiceInformation.sCAIDs)
			except:
				ecminfo = " "
					
		if self.type == self.emuname:
			serlist = None
			camdlist = None
			nameemu = []
			nameser = []
			# TS-Panel
			if fileExists("/etc/startcam.sh"):
				try:
					for line in open("/etc/startcam.sh"):
						if line.find("script") > -1:
							return "%s" % line.split("/")[-1].split()[0][:-3]
				except:
					camdlist = None
					
					
			#HDMU
			elif fileExists("/etc/.emustart") and fileExists("/etc/image-version"):
				try:
					for line in open("/etc/.emustart"):
						return line.split()[0].split('/')[-1]
				except:
					camdlist = None
			# AAF
			elif fileExists("/etc/image-version") and not fileExists("/etc/.emustart"):
				for line in open("/etc/image-version"):
					if line.find("=AAF") > -1:
						for line in open("/etc/enigma2/settings"):
							if line.find("config.softcam.actCam=") > -1:
								return line.split("=")[-1].strip('\n')
			# VTI 	
			elif fileExists("/tmp/.emu.info"):
				try:
					camdlist = open("/tmp/.emu.info", "r")
				except:
					camdlist = None
			# BlackHole	
			elif fileExists("/etc/CurrentBhCamName"):
				try:
					camdlist = open("/etc/CurrentBhCamName", "r")
				except:
					camdlist = None
			# Domica	
			elif fileExists("/etc/active_emu.list"):
				try:
					camdlist = open("/etc/active_emu.list", "r")
				except:
					camdlist = None
			# domica 8120
			elif fileExists("/etc/init.d/cam"):
				for line in open("/etc/enigma2/settings"):
					if line.find("config.plugins.emuman.cam") > -1:
						return line.split("=")[-1].strip('\n')
			#Pli
			elif fileExists("/etc/init.d/softcam") or fileExists("/etc/init.d/cardserver"):
				try:
					for line in open("/etc/init.d/softcam"):
						if line.find("echo") > -1:
							nameemu.append(line)
					camdlist = "%s" % nameemu[1].split('"')[1]
				except:
					pass
				try:
					for line in open("/etc/init.d/cardserver"):
						if line.find("echo") > -1:
							nameser.append(line)
					serlist = "%s" % nameser[1].split('"')[1]
				except:
					pass
				if serlist is None:
					serlist = ""
				elif camdlist is None:
					camdlist = ""
				elif serlist is None and camdlist is None:
					serlist = ""
					camdlist = ""
				return ("%s %s" % (serlist, camdlist))
			# OoZooN
			elif fileExists("/tmp/cam.info"):
				try:
					camdlist = open("/tmp/cam.info", "r")
				except:
					camdlist = None
			# Merlin2	
			elif fileExists("/etc/clist.list"):
				try:
					camdlist = open("/etc/clist.list", "r")
				except:
					camdlist = None
			# GP3
			elif fileExists("/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"):
				try:
					from Plugins.Bp.geminimain.plugin import GETCAMDLIST
					from Plugins.Bp.geminimain.lib import libgeminimain
					camdl = libgeminimain.getPyList(GETCAMDLIST)
					for x in camdl:
						if x[1] == 1:
							camdlist = x[2] 
				except:
					camdlist = None
			# Unknown emu
			else:
				camdlist = None
				
			if serlist is not None:
				try:
					cardserver = ""
					for current in serlist.readlines():
						cardserver = current
					serlist.close()
				except:
					pass
			else:
				cardserver = ""

			if camdlist is not None:
				try:
					emu = ""
					for current in camdlist.readlines():
						emu = current
					camdlist.close()
				except:
					pass
			else:
				emu = ""
			ecminfo = "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
		return ecminfo
	def getText(self):
		ecminfo = ""
		caidvalue = ""
		service = self.source.service
		info = service and service.info()
		if not info:
			return ""
		if self.type == self.vtype:
			try:
				return ("MPEG2", "MPEG4", "MPEG1", "MPEG4-II", "VC1", "VC1-SM", "")[info.getInfo(iServiceInformation.sVideoType)]
			except: 
				return " "
		elif self.type == self.bitrate:
			try:
				audio = service and service.audioTracks()
				if audio:
					if audio.getCurrentTrack() > -1:
						if self.audio is not 0 or self.video is not 0:
							audioTrackCodec = str(audio.getTrackInfo(audio.getCurrentTrack()).getDescription()) or ""
						else:
							audioTrackCodec = ""
				else:
					audioTrackCodec = ""
				yres = info.getInfo(iServiceInformation.sVideoHeight)
				mode = ("i", "p", "")[info.getInfo(iServiceInformation.sProgressive)]
				xres = info.getInfo(iServiceInformation.sVideoWidth)
				return "%sx%s(%sfps)     VIDEO :%s     Vbit : %d kbit/s       AUDIO :%s     Abit : %d kbit/s" % (str(xres), str(yres) + mode, self.getServiceInfoString(info, iServiceInformation.sFrameRate, lambda x: "%d" % ((x+500)/1000)), ("MPEG2", "MPEG4", "MPEG1", "MPEG4-II", "VC1", "VC1-SM", "")[info.getInfo(iServiceInformation.sVideoType)], self.video, audioTrackCodec, self.audio)
			except: 
				return " "
		elif self.type == self.txtcaid:
			caidvalue = "%s" % self.systemTxtCaids.get(self.caidstr()[:2].upper()) 
			if caidvalue != "None":
				return caidvalue
			else:
				return " "
		elif self.type == self.ecmfile:
			if self.getServiceInfoString(info, iServiceInformation.sCAIDs):
				try:
					for line in open("/tmp/ecm.info"):
						if "caid:" in line or "provider:" in line or "provid:" in line or "pid:" in line or "hops:" in line  or "system:" in line or "address:" in line or "using:" in line or "ecm time:" in line:
							line = line.replace(' ',"").replace(":",": ")
						if "caid:" in line or "pid:" in line or "reader:" in line or "from:" in line or "hops:" in line  or "system:" in line or "Service:" in line or "CAID:" in line or "Provider:" in line:
							line = line.strip('\n') + "  "
						if "Signature" in line:
							line = ""
						if "=" in line:
							line = line.lstrip('=').replace('======', "").replace('\n', "").rstrip() + ', '
						if "ecmtime:" in line:
							line = line.replace("ecmtime:", "ecm time:")
						if "response time:" in line:
							line = line.replace("response time:", "ecm time:").replace("decoded by", "by")
						if not line.startswith('\n'):
							if 'pkey:' in line:
								line = '\n' + line + '\n'
							ecminfo += line
				except:
					pass
###############################################################################
		elif self.type == self.activecaid:
			caidvalue = self.caidstr()
			return caidvalue
		elif self.type == self.pids:
			try:
				return "SID: %0.4X  VPID: %0.4X  APID: %0.4X  PRCPID: %0.4X  TSID: %0.4X  ONID: %0.4X" % (int(self.getServiceInfoString(info, iServiceInformation.sSID)), int(self.getServiceInfoString(info, iServiceInformation.sVideoPID)), int(self.getServiceInfoString(info, iServiceInformation.sAudioPID)), int(self.getServiceInfoString(info, iServiceInformation.sPCRPID)), int(self.getServiceInfoString(info, iServiceInformation.sTSID)), int(self.getServiceInfoString(info, iServiceInformation.sONID)))
			except:
				try:
					return "SID: %0.4X  APID: %0.4X  PRCPID: %0.4X  TSID: %0.4X  ONID: %0.4X" % (int(self.getServiceInfoString(info, iServiceInformation.sSID)), int(self.getServiceInfoString(info, iServiceInformation.sAudioPID)), int(self.getServiceInfoString(info, iServiceInformation.sPCRPID)), int(self.getServiceInfoString(info, iServiceInformation.sTSID)), int(self.getServiceInfoString(info, iServiceInformation.sONID)))
				except:
					try:
						return "SID: %0.4X  VPID: %0.4X  PRCPID: %0.4X  TSID: %0.4X  ONID: %0.4X" % (int(self.getServiceInfoString(info, iServiceInformation.sSID)), int(self.getServiceInfoString(info, iServiceInformation.sVideoPID)), int(self.getServiceInfoString(info, iServiceInformation.sPCRPID)), int(self.getServiceInfoString(info, iServiceInformation.sTSID)), int(self.getServiceInfoString(info, iServiceInformation.sONID)))
					except:
						return ""
		elif self.type == self.caids:
			array_caids = []
			try:
				ecminfo = self.getServiceInfoString2(info, iServiceInformation.sCAIDs)
				if ecminfo == "-1":
					return " "
				for caid in ecminfo.split():
					array_caids.append(caid)
				ecminfo = ' '.join(str(x) for x in set(array_caids))
			except:
				ecminfo = " "
		if self.type == self.emuname:
			serlist = None
			camdlist = None
			nameemu = []
			nameser = []
			# GlassSysUtil 
			if fileExists("/tmp/ucm_cam.info"):
				return open("/tmp/ucm_cam.info").read()
			#Pli
			elif fileExists("/etc/init.d/softcam") or fileExists("/etc/init.d/cardserver"):
				try:
					for line in open("/etc/init.d/softcam"):
						if "echo" in line:
							nameemu.append(line)
					camdlist = "%s" % nameemu[1].split('"')[1]
				except:
					pass
				try:
					for line in open("/etc/init.d/cardserver"):
						if "echo" in line:
							nameser.append(line)
					serlist = "%s" % nameser[1].split('"')[1]
				except:
					pass
				if serlist is not None and camdlist is not None:
					return ("%s %s" % (serlist, camdlist))
				elif camdlist is not None:
					return "%s" % camdlist
				elif serlist is not None:
					return "%s" % serlist
				return ""
			# Alternative SoftCam Manager 
			elif fileExists("/usr/lib/enigma2/python/Plugins/Extensions/AlternativeSoftCamManager/plugin.py"): 
				if config.plugins.AltSoftcam.actcam.value != "none": 
					return config.plugins.AltSoftcam.actcam.value 
				else: 
					return None
			# TS-Panel
			elif fileExists("/etc/startcam.sh"):
				try:
					for line in open("/etc/startcam.sh"):
						if "script" in line:
							return "%s" % line.split("/")[-1].split()[0][:-3]
				except:
					camdlist = None
			# domica 8120
			elif fileExists("/etc/init.d/cam"):
				if config.plugins.emuman.cam.value: 
					return config.plugins.emuman.cam.value
			#PKT
			elif fileExists("//usr/lib/enigma2/python/Plugins/Extensions/PKT/plugin.pyo"):
				if config.plugins.emuman.cam.value: 
					return config.plugins.emuman.cam.value
			#HDMU
			elif fileExists("/etc/.emustart") and fileExists("/etc/image-version"):
				try:
					for line in open("/etc/.emustart"):
						return line.split()[0].split('/')[-1]
				except:
					camdlist = None
			# AAF & ATV & VTI 
			elif fileExists("/etc/image-version") and not fileExists("/etc/.emustart"):
				emu = ""
				server = ""
				for line in open("/etc/image-version"):
					if "=AAF" in line or "=openATV" in line:
						if config.softcam.actCam.value: 
							emu = config.softcam.actCam.value
						if config.softcam.actCam2.value: 
							server = config.softcam.actCam2.value
							if config.softcam.actCam2.value == "no CAM 2 active":
								server = ""
					elif "=vuplus" in line:
						if fileExists("/tmp/.emu.info"):
							for line in open("/tmp/.emu.info"):
								emu = line.strip('\n')
					# BlackHole
					elif "version=" in line and fileExists("/etc/CurrentBhCamName"):
						emu = open("/etc/CurrentBhCamName").read()
				return "%s %s" % (emu, server)
			# Domica	
			elif fileExists("/etc/active_emu.list"):
				try:
					camdlist = open("/etc/active_emu.list", "r")
				except:
					camdlist = None
			# OoZooN
			elif fileExists("/tmp/cam.info"):
				try:
					camdlist = open("/tmp/cam.info", "r")
				except:
					camdlist = None
			# Merlin2	
			elif fileExists("/etc/clist.list"):
				try:
					camdlist = open("/etc/clist.list", "r")
				except:
					camdlist = None
			# GP3
			elif fileExists("/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"):
				try:
					from Plugins.Bp.geminimain.plugin import GETCAMDLIST
					from Plugins.Bp.geminimain.lib import libgeminimain
					camdl = libgeminimain.getPyList(GETCAMDLIST)
					for x in camdl:
						if x[1] == 1:
							camdlist = x[2] 
				except:
					camdlist = None
			# Unknown emu
			else:
				camdlist = None
				
			if serlist is not None:
				try:
					cardserver = ""
					for current in serlist.readlines():
						cardserver = current
					serlist.close()
				except:
					pass
			else:
				cardserver = ""
			if camdlist is not None:
				try:
					emu = ""
					for current in camdlist.readlines():
						emu = current
					camdlist.close()
				except:
					pass
			else:
				emu = ""
			ecminfo = "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
		return ecminfo
Exemple #12
0
    def getText(self):
        info = ''
        info2 = ''
        nofile = False
        camdname = None
        cardname = None
        camdlist = None

        # Alternative SoftCam Manager

        if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/AlternativeSoftCamManager/plugin.py'
                      ):
            if config.plugins.AltSoftcam.actcam.value != 'none':

                # camdname = StringIO(config.plugins.AltSoftcam.actcam.value)

                camdname = config.plugins.AltSoftcam.actcam.value
                nofile = True
            else:
                camdname = None
        elif fileExists('/tmp/.emu.info'):

        # VTI ....

            try:
                camdname = open('/tmp/.emu.info', 'r')
            except:
                camdname = None
        elif fileExists('/etc/startcam.sh'):

        # TS-Panel

            try:
                camdname = open('/etc/startcam.sh', 'r')
            except:
                camdname = None
        elif fileExists('/etc/CurrentBhCamName'):

        # BlackHole....

            try:
                camdname = open('/etc/CurrentBhCamName', 'r')
            except:
                camdname = None
        elif fileExists('/etc/active_emu.list'):

        # Domica....

            try:
                camdname = open('/etc/active_emu.list', 'r')
            except:
                camdname = None
        elif fileExists('/tmp/cam.info'):

                # OoZooN

            try:
                camdname = open('/tmp/cam.info', 'r')
            except:
                camdname = None
        elif fileExists('/etc/clist.list'):

        # Merlin2....

            try:
                camdname = open('/etc/clist.list', 'r')
            except:
                camdname = None
        elif fileExists('/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so'
                        ):

        # GP3

            try:
                from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                from Plugins.Bp.geminimain.lib import libgeminimain
                camdl = libgeminimain.getPyList(GETCAMDLIST)
                cam = None
                for x in camdl:
                    if x[1] == 1:
                        cam = x[2]
                camdname = cam
                nofile = True
            except:
                camdname = None
        elif fileExists('/etc/init.d/softcam') \
            or fileExists('/etc/init.d/cardserver'):

        # Pli

            try:
                camdname = open('/etc/init.d/softcam', 'r')
            except:
                camdname = None
            try:
                cardname = open('/etc/init.d/cardserver', 'r')
            except:
                cardname = None
        elif fileExists('/etc/.emustart'):
            try:
                camdname = open('/etc/.emustart', 'r')
            except:
                camdname = None

        if cardname:
            for line in cardname:
                if 'oscam' in line.lower():
                    info2 = 'oscam'
                elif 'newcs' in line.lower():
                    info2 = 'newcs'
                elif 'wicard' in line.lower():
                    info2 = 'wicardd'
                elif 'cccam' in line.lower():
                    info2 = 'cccam'
                elif 'mgcamd' in line.lower():
                    info2 = 'mgcamd'
            cardname.close()
        if camdname:
            camdlist = camdname
        if camdlist:
            info = 'unknow'
            if nofile:
                if nofile:
                    line = camdlist
            else:
                for line in camdlist:
                    if 'mgcamd' in line.lower() and 'oscam' \
                        in line.lower():
                        info = 'oscammgcamd'
                        break
                    if 'cccam' in line.lower() and 'oscam' \
                        in line.lower():
                        info = 'oscamcccam'
                        break
                    elif 'mgcamd' in line.lower():
                        info = 'mgcamd'
                    elif 'oscam' in line.lower():
                        info = 'oscam'
                    elif 'ncam' in line.lower():
                        info = 'ncam'
                    elif 'gcam' in line.lower():
                        info = 'gcam'
                    elif 'wicard' in line.lower():
                        info = 'wicardd'
                    elif 'cccam' in line.lower():
                        info = 'cccam'
                    elif 'camd3' in line.lower():
                        info = 'camd3'
                    elif 'evocamd' in line.lower():
                        info = 'evocamd'
                    elif 'newcs' in line.lower():
                        info = 'newcs'
                    elif 'rqcamd' in line.lower():
                        info = 'rqcamd'
                    elif 'gbox' in line.lower():
                        info = 'gbox'
                    elif 'mpcs' in line.lower():
                        info = 'mpcs'
                    elif 'sbox' in line.lower():
                        info = 'sbox'
        if camdname and not nofile:
            camdname.close()
        return info2 + info
	def getText(self):
		service = self.source.service
		info = service and service.info()
		camd = ""
		serlist = None
		camdlist = None
		nameemu = []
		nameser = []
		if not info:
			return ""
		# TS-Panel
		if fileExists("/etc/startcam.sh"):
			try:
				for line in open("/etc/startcam.sh"):
					if line.find("script") > -1:
						return "%s" % line.split("/")[-1].split()[0][:-3]
			except:
				camdlist = None
		# VTI 	
		elif fileExists("/tmp/.emu.info"):
			try:
				camdlist = open("/tmp/.emu.info", "r")
			except:
				return None
		# BlackHole	
		elif fileExists("/etc/CurrentBhCamName"):
			try:
				camdlist = open("/etc/CurrentBhCamName", "r")
			except:
				return None
		# Domica	
		elif fileExists("/etc/active_emu.list"):
			try:
				camdlist = open("/etc/active_emu.list", "r")
			except:
				return None
		# Egami	
		elif fileExists("/tmp/egami.inf","r"):
			lines = open("/tmp/egami.inf", "r").readlines()
			for line in lines:
				item = line.split(":",1)
				if item[0] == "Current emulator":
					return item[1].strip()
		#Pli
		elif fileExists("/etc/init.d/softcam") or fileExists("/etc/init.d/cardserver"):
			try:
				for line in open("/etc/init.d/softcam"):
					if line.find("echo") > -1:
						nameemu.append(line)
				camdlist = "%s" % nameemu[1].split('"')[1]
			except:
				pass
			try:
				for line in open("/etc/init.d/cardserver"):
					if line.find("echo") > -1:
						nameser.append(line)
				serlist = "%s" % nameser[1].split('"')[1]
			except:
				pass
			if serlist is None:
				serlist = ""
			elif camdlist is None:
				camdlist = ""
			elif serlist is None and camdlist is None:
				serlist = ""
				camdlist = ""
			return ("%s %s" % (serlist, camdlist))
		# OoZooN
		elif fileExists("/tmp/cam.info"):
			try:
				camdlist = open("/tmp/cam.info", "r")
			except:
				return None
		# Merlin2	
		elif fileExists("/etc/clist.list"):
			try:
				camdlist = open("/etc/clist.list", "r")
			except:
				return None
		# GP3
		elif fileExists("/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"):
			try:
				from Plugins.Bp.geminimain.plugin import GETCAMDLIST
				from Plugins.Bp.geminimain.lib import libgeminimain
				camdl = libgeminimain.getPyList(GETCAMDLIST)
				cam = None
				for x in camdl:
					if x[1] == 1:
						cam = x[2] 
				return cam
		   	except:
				return None
		else:
			return None
			
		if serlist is not None:
			try:
				cardserver = ""
				for current in serlist.readlines():
					cardserver = current
				serlist.close()
			except:
				pass
		else:
			cardserver = " "

		if camdlist is not None:
			try:
				emu = ""
				for current in camdlist.readlines():
					emu = current
				camdlist.close()
			except:
				pass
		else:
			emu = " "
			
		return "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
    def getText(self):
        info = info2 = ""
        nofile = False
        camdname = cardname = camdlist = None
        # Alternative SoftCam Manager
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/AlternativeSoftCamManager/plugin.pyo"
        ):
            if config.plugins.AltSoftcam.actcam.value is not None:
                camdname = StringIO(config.plugins.AltSoftcam.actcam.value)
            else:
                camdname = None
        # E-Panel
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/epanel/plugin.pyo"
        ):
            if config.plugins.epanel.activeemu.value is not None:
                camdname = StringIO(config.plugins.epanel.activeemu.value)
            else:
                camdname = None
        # VTI
        elif fileExists("/tmp/.emu.info"):
            try:
                camdname = open("/tmp/.emu.info", "r")
            except:
                camdname = None
        # TS-Panel
        elif fileExists("/etc/startcam.sh"):
            try:
                camdname = open("/etc/startcam.sh", "r")
            except:
                camdname = None
        # BlackHole
        elif fileExists("/etc/CurrentBhCamName"):
            try:
                camdname = open("/etc/CurrentBhCamName", "r")
            except:
                camdname = None
        # Domica
        elif fileExists("/etc/active_emu.list"):
            try:
                camdname = open("/etc/active_emu.list", "r")
            except:
                camdname = None
        # OoZooN
        elif fileExists("/tmp/cam.info"):
            try:
                camdname = open("/tmp/cam.info", "r")
            except:
                camdname = None
        # Merlin2
        elif fileExists("/etc/clist.list"):
            try:
                camdname = open("/etc/clist.list", "r")
            except:
                camdname = None
        # HDMU
        elif fileExists("/etc/.emustart"):
            try:
                camdname = open("/etc/.emustart", "r")
            except:
                camdname = None
        # GP3
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"
        ):
            try:
                from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                from Plugins.Bp.geminimain.lib import libgeminimain
                camdl = libgeminimain.getPyList(GETCAMDLIST)
                cam = None
                for x in camdl:
                    if x[1] == 1:
                        cam = x[2]
                camdname = cam
                nofile = True
            except:
                camdname = None
        # Pli & HDF & ATV & AAF
        elif fileExists("/etc/issue"):
            for line in open("/etc/issue"):
                if 'openatv' in line or 'openaaf' in line:
                    if config.softcam.actCam.value:
                        camdname = StringIO(config.softcam.actCam.value)
                elif 'openpli' in line or 'openhdf' in line:
                    try:
                        camdname = open("/etc/init.d/softcam", "r")
                    except:
                        camdname = None
                    try:
                        cardname = open("/etc/init.d/cardserver", "r")
                    except:
                        cardname = None

        if cardname:
            for line in cardname:
                if 'oscam' in line.lower():
                    info2 = 'oscam'
                elif 'newcs' in line.lower():
                    info2 = 'newcs'
                elif 'wicard' in line.lower():
                    info2 = 'wicardd'
                elif 'cccam' in line.lower():
                    info2 = 'cccam'
                elif 'mgcamd' in line.lower():
                    info2 = 'mgcamd'
            cardname.close()
        if camdname:
            camdlist = camdname
        if camdlist:
            info = 'unknow'
            if nofile:
                if nofile:
                    line = camdlist
            else:
                for line in camdlist:
                    if 'mgcamd' in line.lower() and 'oscam' in line.lower():
                        info = 'oscammgcamd'
                        break
                    if 'cccam' in line.lower() and 'oscam' in line.lower():
                        info = 'oscamcccam'
                        break
                    elif 'mgcamd' in line.lower():
                        info = 'mgcamd'
                    elif 'oscam' in line.lower():
                        info = 'oscam'
                    elif 'ncam' in line.lower():
                        info = 'ncam'
                    elif 'gcam' in line.lower():
                        info = 'gcam'
                    elif 'wicard' in line.lower():
                        info = 'wicardd'
                    elif 'cccam' in line.lower():
                        info = 'cccam'
                    elif 'camd3' in line.lower():
                        info = 'camd3'
                    elif 'evocamd' in line.lower():
                        info = 'evocamd'
                    elif 'newcs' in line.lower():
                        info = 'newcs'
                    elif 'rqcamd' in line.lower():
                        info = 'rqcamd'
                    elif 'gbox' in line.lower():
                        info = 'gbox'
                    elif 'mpcs' in line.lower():
                        info = 'mpcs'
                    elif 'sbox' in line.lower():
                        info = 'sbox'
        if camdname and not nofile:
            camdname.close()
        return info2 + info
	def getText(self):
		info = info2 = ""
		nofile = False
		camdname = cardname = camdlist = None
		# Alternative SoftCam Manager
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/AlternativeSoftCamManager/plugin.pyo"):
			if config.plugins.AltSoftcam.actcam.value is not None:
				camdname = StringIO(config.plugins.AltSoftcam.actcam.value)
			else:
				camdname = None
		# E-Panel
		elif fileExists("/usr/lib/enigma2/python/Plugins/Extensions/epanel/plugin.pyo"):
			if config.plugins.epanel.activeemu.value is not None:
				camdname = StringIO(config.plugins.epanel.activeemu.value)
			else:
				camdname = None
		# VTI
		elif fileExists("/tmp/.emu.info"):
			try:
				camdname = open("/tmp/.emu.info", "r")
			except:
				camdname = None
		# TS-Panel
		elif fileExists("/etc/startcam.sh"):
			try:
				camdname = open("/etc/startcam.sh", "r")
			except:
				camdname = None
		# BlackHole
		elif fileExists("/etc/CurrentBhCamName"):
			try:
				camdname = open("/etc/CurrentBhCamName", "r")
			except:
				camdname = None
		# Domica
		elif fileExists("/etc/active_emu.list"):
			try:
				camdname = open("/etc/active_emu.list", "r")
			except:
				camdname = None
		# OoZooN
		elif fileExists("/tmp/cam.info"):
			try:
				camdname = open("/tmp/cam.info", "r")
			except:
				camdname = None
		# Merlin2
		elif fileExists("/etc/clist.list"):
			try:
				camdname = open("/etc/clist.list", "r")
			except:
				camdname = None
		# HDMU
		elif fileExists("/etc/.emustart"):
			try:
				camdname = open("/etc/.emustart", "r")
			except:
				camdname = None
		# GP3
		elif fileExists("/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"):
			try:
				from Plugins.Bp.geminimain.plugin import GETCAMDLIST
				from Plugins.Bp.geminimain.lib import libgeminimain
				camdl = libgeminimain.getPyList(GETCAMDLIST)
				cam = None
				for x in camdl:
					if x[1] == 1:
						cam = x[2]
				camdname = cam
				nofile = True
			except:
				camdname = None
		# Pli & HDF & ATV & AAF
		elif fileExists("/etc/issue"):
			for line in open("/etc/issue"):
				if 'openatv' in line or 'openaaf' in line:
					if config.softcam.actCam.value:
						camdname = StringIO(config.softcam.actCam.value)
				elif 'openpli' in line or 'openhdf' in line:
					try:
						camdname = open("/etc/init.d/softcam", "r")
					except:
						camdname = None
					try:
						cardname = open("/etc/init.d/cardserver", "r")
					except:
						cardname = None

		if cardname:
			for line in cardname:
				if 'oscam' in line.lower():
					info2 = 'oscam'
				elif 'newcs' in line.lower():
					info2 = 'newcs'
				elif 'wicard' in line.lower():
					info2 = 'wicardd'
				elif 'cccam' in line.lower():
					info2 = 'cccam'
				elif 'mgcamd' in line.lower():
					info2 = 'mgcamd'
			cardname.close()
		if camdname:
			camdlist = camdname
		if camdlist:
			info = 'unknow'
			if nofile:
				if nofile:
					line = camdlist
			else:
				for line in camdlist:
					if 'mgcamd' in line.lower() and 'oscam' in line.lower():
						info = 'oscammgcamd'
						break
					if 'cccam' in line.lower() and 'oscam' in line.lower():
						info = 'oscamcccam'
						break
					elif 'mgcamd' in line.lower():
						info = 'mgcamd'
					elif 'oscam' in line.lower():
						info = 'oscam'
					elif 'ncam' in line.lower():
						info = 'ncam'
					elif 'gcam' in line.lower():
						info = 'gcam'
					elif 'wicard' in line.lower():
						info = 'wicardd'
					elif 'cccam' in line.lower():
						info = 'cccam'
					elif 'camd3' in line.lower():
						info = 'camd3'
					elif 'evocamd' in line.lower():
						info = 'evocamd'
					elif 'newcs' in line.lower():
						info = 'newcs'
					elif 'rqcamd' in line.lower():
						info = 'rqcamd'
					elif 'gbox' in line.lower():
						info = 'gbox'
					elif 'mpcs' in line.lower():
						info = 'mpcs'
					elif 'sbox' in line.lower():
						info = 'sbox'
		if camdname and not nofile:
			camdname.close()
		return info2 + info
    def getText(self):
        service = self.source.service
        info = service and service.info()
        if not service:
            return None
        camd = ""
        emu = ""
        server = ""
        serlist = None
        camdlist = None
        nameemu = []
        nameser = []
        if not info:
            return ""
        # Alternative SoftCam Manager
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/AlternativeSoftCamManager/plugin.pyo"
        ):
            if config.plugins.AltSoftcam.actcam.value is not None:
                return config.plugins.AltSoftcam.actcam.value
            else:
                return None
        # E-Panel
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/epanel/plugin.pyo"
        ):
            if config.plugins.epanel.activeemu.value is not None:
                return config.plugins.epanel.activeemu.value
            else:
                return None
        # PKT
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/PKT/plugin.pyo"):
            if config.plugins.emuman.cam.value is not None:
                return config.plugins.emuman.cam.value
            else:
                return None
        # GlassSysUtil
        elif fileExists("/tmp/ucm_cam.info"):
            try:
                return open("/tmp/ucm_cam.info").read()
            except:
                return None
        # TS-Panel
        elif fileExists("/etc/startcam.sh"):
            try:
                for line in open("/etc/startcam.sh"):
                    if "script" in line:
                        return "%s" % line.split('/')[-1].split()[0][:-3]
            except:
                return None
        # VTI
        elif fileExists("/tmp/.emu.info"):
            try:
                for line in open("/tmp/.emu.info"):
                    return line.strip('\n')
            except:
                return None
        # BlackHole
        elif fileExists("/etc/CurrentBhCamName"):
            try:
                return open("/etc/CurrentBhCamName").read()
            except:
                return None
        # Domica
        elif fileExists("/etc/active_emu.list"):
            try:
                return open("/etc/active_emu.list").read()
            except:
                return None
        # Egami old
        elif os.path.isfile("/etc/CurrentEGCamName"):
            try:
                return open("/etc/CurrentEGCamName").read()
            except:
                return None
        # Egami
        elif fileExists("/tmp/egami.inf"):
            try:
                for line in open("/tmp/egami.inf"):
                    item = line.split(":", 1)
                    if item[0] == "Current emulator":
                        return item[1].strip()
            except:
                return None
        # OoZooN
        elif fileExists("/tmp/cam.info"):
            try:
                return open("/tmp/cam.info").read()
            except:
                return None
        # Merlin2
        elif fileExists("/etc/clist.list"):
            try:
                return open("/etc/clist.list").read()
            except:
                return None
        # HDMU
        elif fileExists("/etc/.emustart"):
            try:
                for line in open("/etc/.emustart"):
                    return line.split()[0].split('/')[-1]
            except:
                return None
        # GP3
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"
        ):
            try:
                from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                from Plugins.Bp.geminimain.lib import libgeminimain
                camdl = libgeminimain.getPyList(GETCAMDLIST)
                cam = None
                for x in camdl:
                    if x[1] == 1:
                        cam = x[2]
                return cam
            except:
                return None
        # Pli & HDF & ATV & AAF
        elif fileExists("/etc/issue"):
            for line in open("/etc/issue"):
                if 'openatv' in line or 'openaaf' in line:
                    if config.softcam.actCam.value:
                        emu = config.softcam.actCam.value
                    if config.softcam.actCam2.value:
                        server = config.softcam.actCam2.value
                        if 'CAM 2' in server:
                            server = ""
                    return "%s %s" % (emu, server)
                elif 'openpli' in line or 'openhdf' in line:
                    try:
                        for line in open("/etc/init.d/softcam"):
                            if 'echo' in line:
                                nameemu.append(line)
                        camdlist = "%s" % nameemu[1].split('"')[1]
                    except:
                        pass
                    try:
                        for line in open("/etc/init.d/cardserver"):
                            if 'echo' in line:
                                nameser.append(line)
                        serlist = "%s" % nameser[1].split('"')[1]
                    except:
                        pass
                    if serlist is not None and camdlist is not None:
                        return ("%s %s" % (serlist, camdlist))
                    elif camdlist is not None:
                        return "%s" % camdlist
                    elif serlist is not None:
                        return "%s" % serlist
                    return ""
        else:
            return None

        if serlist is not None:
            try:
                cardserver = ""
                for current in serlist.readlines():
                    cardserver = current
                serlist.close()
            except:
                pass
        else:
            cardserver = " "

        if camdlist is not None:
            try:
                emu = ""
                for current in camdlist.readlines():
                    emu = current
                camdlist.close()
            except:
                pass
        else:
            emu = " "

        return "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
Exemple #17
0
    def getText(self):
        service = self.source.service
        info = service and service.info()
        camd = ''
        serlist = None
        camdlist = None
        nameemu = []
        nameser = []
        if not info:
            return ''
        elif fileExists('/etc/init.d/softcam') or fileExists(
                '/etc/init.d/cardserver'):
            try:
                for line in open('/etc/init.d/softcam'):
                    if line.find('echo') > -1:
                        nameemu.append(line)

                camdlist = '%s' % nameemu[1].split('"')[1]
            except:
                pass

            try:
                for line in open('/etc/init.d/cardserver'):
                    if line.find('echo') > -1:
                        nameser.append(line)

                serlist = '%s' % nameser[1].split('"')[1]
            except:
                pass

            if serlist is None:
                serlist = ''
            elif camdlist is None:
                camdlist = ''
            elif serlist is None and camdlist is None:
                serlist = ''
                camdlist = ''
            return '%s %s' % (serlist, camdlist)
        else:
            if fileExists('/etc/startcam.sh'):
                try:
                    for line in open('/etc/startcam.sh'):
                        if line.find('script') > -1:
                            return '%s' % line.split('/')[-1].split()[0][:-3]

                except:
                    camdlist = None

            elif fileExists('/etc/CurrentDelCamName'):
                try:
                    camdlist = open('/etc/CurrentDelCamName', 'r')
                except:
                    return

            elif fileExists('/etc/BhFpConf'):
                try:
                    camdlist = open('/etc/BhCamConf', 'r')
                except:
                    return

            elif fileExists(
                    '/usr/lib/enigma2/python/Plugins/Extensions/PKT/plugin.pyo'
            ):
                if config.plugins.emuman.cam.value:
                    return config.plugins.emuman.cam.value
            elif fileExists(
                    '/usr/lib/enigma2/python/Plugins/newnigma2/eCamdCtrl/eCamdctrl.pyo'
            ):
                from Plugins.newnigma2.eCamdCtrl.eCamdctrl import runningcamd
                if config.plugins.camdname.skin.value:
                    return runningcamd.getCamdCurrent()
            elif fileExists('/etc/.emustart') and fileExists(
                    '/etc/image-version'):
                try:
                    for line in open('/etc/.emustart'):
                        return line.split()[0].split('/')[-1]

                except:
                    return

            else:
                if fileExists('/etc/image-version'
                              ) and not fileExists('/etc/.emustart'):
                    emu = ''
                    server = ''
                    for line in open('/etc/image-version'):
                        if '=AAF' in line or '=openATV' in line or '=opendroid' in line:
                            if config.softcam.actCam.value:
                                emu = config.softcam.actCam.value
                            if config.softcam.actCam2.value:
                                server = config.softcam.actCam2.value
                                if config.softcam.actCam2.value == 'no CAM 2 active':
                                    server = ''
                        elif '=vuplus' in line:
                            if fileExists('/tmp/.emu.info'):
                                for line in open('/tmp/.emu.info'):
                                    emu = line.strip('\n')

                        elif 'version=' in line and fileExists(
                                '/etc/CurrentBhCamName'):
                            emu = open('/etc/CurrentBhCamName').read()

                    return '%s %s' % (emu, server)
                if fileExists('/etc/active_emu.list'):
                    try:
                        camdlist = open('/etc/active_emu.list', 'r')
                    except:
                        return

                elif fileExists('/tmp/egami.inf', 'r'):
                    lines = open('/tmp/egami.inf', 'r').readlines()
                    for line in lines:
                        item = line.split(':', 1)
                        if item[0] == 'Current emulator':
                            return item[1].strip()

                else:
                    if fileExists('/tmp/ucm_cam.info'):
                        return open('/tmp/ucm_cam.info').read()
                    if fileExists('/tmp/cam.info'):
                        try:
                            camdlist = open('/tmp/cam.info', 'r')
                        except:
                            return

                    elif fileExists('/usr/bin/emuactive'):
                        try:
                            camdlist = open('/usr/bin/emuactive', 'r')
                        except:
                            return

                    elif fileExists('/etc/clist.list'):
                        try:
                            camdlist = open('/etc/clist.list', 'r')
                        except:
                            return

                    elif fileExists(
                            '/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so'
                    ):
                        try:
                            from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                            from Plugins.Bp.geminimain.lib import libgeminimain
                            camdl = libgeminimain.getPyList(GETCAMDLIST)
                            cam = None
                            for x in camdl:
                                if x[1] == 1:
                                    cam = x[2]

                            return cam
                        except:
                            return

                    else:
                        return
            if serlist is not None:
                try:
                    cardserver = ''
                    for current in serlist.readlines():
                        cardserver = current

                    serlist.close()
                except:
                    pass

            else:
                cardserver = 'NA'
            if camdlist is not None:
                try:
                    emu = ''
                    for current in camdlist.readlines():
                        emu = current

                    camdlist.close()
                except:
                    pass

            else:
                emu = 'NA'
            return '%s %s' % (cardserver.split('\n')[0], emu.split('\n')[0])
Exemple #18
0
    def getText(self):
        service = self.source.service
        info = service and service.info()
        camd = ''
        camdlist = None
        serlist = None
        if not info:
            return ''
        else:
            if fileExists('/tmp/.emu.info'):
                try:
                    camdlist = open('/tmp/.emu.info', 'r')
                except:
                    return

            elif fileExists('/etc/CurrentBhCamName'):
                try:
                    camdlist = open('/etc/CurrentBhCamName', 'r')
                except:
                    return

            elif fileExists('/etc/active_emu.list'):
                try:
                    camdlist = open('/etc/.active_emu.list', 'r')
                except:
                    return

            elif fileExists('/tmp/egami.inf', 'r'):
                lines = open('/tmp/egami.inf', 'r').readlines()
                for line in lines:
                    item = line.split(':', 1)
                    if item[0] == 'Current emulator':
                        return item[1].strip()

            elif fileExists('/etc/init.d/softcam') or fileExists('/etc/init.d/cardserver') or fileExists('/etc/.ActiveCamd'):
                try:
                    camdlist = os.popen('/etc/init.d/softcam info')
                except:
                    pass

                try:
                    serlist = os.popen('/etc/init.d/cardserver info')
                except:
                    pass

                try:
                    camdlist = open('/etc/.ActiveCamd', 'r')
                except:
                    pass

            elif fileExists('/tmp/cam.info'):
                try:
                    camdlist = open('/tmp/cam.info', 'r')
                except:
                    return

            elif fileExists('/etc/clist.list'):
                try:
                    camdlist = open('/etc/clist.list', 'r')
                except:
                    return

            elif fileExists('/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so'):
                try:
                    from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                    from Plugins.Bp.geminimain.lib import libgeminimain
                    camdl = libgeminimain.getPyList(GETCAMDLIST)
                    cam = None
                    for x in camdl:
                        if x[1] == 1:
                            cam = x[2]

                    return cam
                except:
                    return

            else:
                return
            if serlist is not None:
                try:
                    cardserver = ''
                    for current in serlist.readlines():
                        cardserver = current

                    serlist.close()
                except:
                    pass

            else:
                cardserver = 'NA'
            if camdlist is not None:
                try:
                    emu = ''
                    for current in camdlist.readlines():
                        emu = current

                    camdlist.close()
                except:
                    pass

            else:
                emu = 'NA'
            return '%s %s' % (cardserver.split('\n')[0], emu.split('\n')[0])
    def getText(self):
        service = self.source.service
        info = service and service.info()
        if not service:
            return None
        camd = ""
        serlist = None
        camdlist = None
        nameemu = []
        nameser = []
        if not info:
            return ""
        # Alternative SoftCam Manager
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/AlternativeSoftCamManager/plugin.py"
        ):
            if config.plugins.AltSoftcam.actcam.value != "none":
                return config.plugins.AltSoftcam.actcam.value
            else:
                return None
        #  GlassSysUtil
        elif fileExists("/tmp/ucm_cam.info"):
            return open("/tmp/ucm_cam.info").read()
        # egami
        elif os.path.isfile("/tmp/egami.inf"):
            for line in open("/tmp/egami.inf"):
                if 'Current emulator:' in line:
                    return line.split(':')[-1].lstrip().strip('\n')
        # Pli
        elif fileExists("/etc/init.d/softcam") or fileExists(
                "/etc/init.d/cardserver"):
            try:
                for line in open("/etc/init.d/softcam"):
                    if "echo" in line:
                        nameemu.append(line)
                camdlist = "%s" % nameemu[1].split('"')[1]
            except:
                pass
            try:
                for line in open("/etc/init.d/cardserver"):
                    if "echo" in line:
                        nameser.append(line)
                serlist = "%s" % nameser[1].split('"')[1]
            except:
                pass
            if serlist != None and camdlist != None:
                return ("%s %s" % (serlist, camdlist))
            elif camdlist != None:
                return "%s" % camdlist
            elif serlist != None:
                return "%s" % serlist
            return ""
        # TS-Panel & Ts images
        elif fileExists("/etc/startcam.sh"):
            try:
                for line in open("/etc/startcam.sh"):
                    if "script" in line:
                        return "%s" % line.split("/")[-1].split()[0][:-3]
            except:
                camdlist = None
        # domica 8
        elif fileExists("/etc/init.d/cam"):
            if config.plugins.emuman.cam.value:
                return config.plugins.emuman.cam.value
        #PKT
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/PKT/plugin.pyo"):
            if config.plugins.emuman.cam.value:
                return config.plugins.emuman.cam.value
        #HDMU
        elif fileExists("/etc/.emustart") and fileExists("/etc/image-version"):
            try:
                for line in open("/etc/.emustart"):
                    return line.split()[0].split('/')[-1]
            except:
                return None
        # Domica
        elif fileExists("/etc/active_emu.list"):
            try:
                camdlist = open("/etc/active_emu.list", "r")
            except:
                return None
        # Egami
        elif fileExists("/tmp/egami.inf", "r"):
            for line in open("/tmp/egami.inf"):
                item = line.split(":", 1)
                if item[0] == "Current emulator":
                    return item[1].strip()

        # OoZooN
        elif fileExists("/tmp/cam.info"):
            try:
                camdlist = open("/tmp/cam.info", "r")
            except:
                return None
        # Merlin 2 & 3
        elif fileExists("/etc/clist.list"):
            try:
                camdlist = open("/etc/clist.list", "r")
            except:
                return None
        # ItalySat
        elif fileExists("/etc/CurrentItalyCamName"):
            try:
                camdlist = open("/etc/CurrentItalyCamName", "r")
            except:
                return None
        # BlackHole OE1.6
        elif fileExists("/etc/CurrentDelCamName"):
            try:
                camdlist = open("/etc/CurrentDelCamName", "r")
            except:
                return None
        # DE-OpenBlackHole
        elif fileExists("/etc/BhFpConf"):
            try:
                camdlist = open("/etc/BhCamConf", "r")
            except:
                return None
        #Newnigma2 OE2.0
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/newnigma2/eCamdCtrl/eCamdctrl.pyo"
        ):
            try:
                from Plugins.newnigma2.eCamdCtrl.eCamdctrl import runningcamd
                if config.plugins.camdname.skin.value:
                    return runningcamd.getCamdCurrent()
            except:
                return None
        #Newnigma2 OE2.5
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/newnigma2/camdctrl/camdctrl.pyo"
        ):
            if config.plugins.camdname.skin.value:
                return config.usage.emu_name.value
            return None
        # GP3
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"
        ):
            try:
                from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                from Plugins.Bp.geminimain.lib import libgeminimain
                camdl = libgeminimain.getPyList(GETCAMDLIST)
                cam = None
                for x in camdl:
                    if x[1] == 1:
                        cam = x[2]
                return cam
            except:
                return None
        # GP4
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/GP4/geminicamswitch/gscamtools.so"
        ):
            from Plugins.GP4.geminicamswitch.gscamtools import readjsons
            if config.gcammanager.currentbinary.value:
                return config.gcammanager.currentbinary.value
            return None
        # Dream Elite
        elif fileExists("/usr/lib/enigma2/python/DE/DEPanel.so"):
            try:
                from DE.DELibrary import Tool
                t = Tool()
                emuname = t.readEmuName(t.readEmuActive()).strip()
                emuactive = emuname != "None" and emuname or t.readEmuName(
                    t.readCrdsrvActive()).strip()
                return emuactive
            except:
                return None
        # AAF & ATV & VTI
        elif fileExists(
                "/etc/image-version") and not fileExists("/etc/.emustart"):
            emu = ""
            server = ""
            for line in open("/etc/image-version"):
                l = line.lower()
                ## Should write name be small letters
                if "=aff" in l or "=openatv" in l or "=opendroid" in l or "=openesi" in l or "=openplus" in l:
                    if config.softcam.actCam.value:
                        emu = config.softcam.actCam.value
                    if config.softcam.actCam2.value:
                        server = config.softcam.actCam2.value
                        if config.softcam.actCam2.value == "no CAM 2 active":
                            server = ""
                elif "=vuplus" in line:
                    if fileExists("/tmp/.emu.info"):
                        for line in open("/tmp/.emu.info"):
                            emu = line.strip('\n')
                # BlackHole
                elif "version=" in line and fileExists(
                        "/etc/CurrentBhCamName"):
                    emu = open("/etc/CurrentBhCamName").read()
            return "%s %s" % (emu, server)
        else:
            return None

        if serlist != None:
            try:
                cardserver = ""
                for current in serlist.readlines():
                    cardserver = current
                serlist.close()
            except:
                pass
        else:
            cardserver = " "

        if camdlist != None:
            try:
                emu = ""
                for current in camdlist.readlines():
                    emu = current
                camdlist.close()
            except:
                pass
        else:
            emu = " "

        return "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
Exemple #20
0
    def getText(self):
        info = ""
        info2 = ""
        nofile = False
        camdname = None
        cardname = None
        camdlist = None
        # VTI
        if fileExists("/tmp/.emu.info"):
            try:
                camdname = open("/tmp/.emu.info", "r")
            except:
                camdname = None
        # TS-Panel
        elif fileExists("/etc/startcam.sh"):
            try:
                camdname = open("/etc/startcam.sh", "r")
            except:
                camdname = None
        # BlackHole
        elif fileExists("/etc/CurrentBhCamName"):
            try:
                camdname = open("/etc/CurrentBhCamName", "r")
            except:
                camdname = None
        # Domica
        elif fileExists("/etc/active_emu.list"):
            try:
                camdname = open("/etc/active_emu.list", "r")
            except:
                camdname = None
                # OoZooN
        elif fileExists("/tmp/cam.info"):
            try:
                camdname = open("/tmp/cam.info", "r")
            except:
                camdname = None
        # Merlin2
        elif fileExists("/etc/clist.list"):
            try:
                camdname = open("/etc/clist.list", "r")
            except:
                camdname = None
        # GP3
        elif fileExists("/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"):
            try:
                from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                from Plugins.Bp.geminimain.lib import libgeminimain
                camdl = libgeminimain.getPyList(GETCAMDLIST)
                cam = None
                for x in camdl:
                    if x[1] == 1:
                        cam = x[2]
                camdname = cam
                nofile = True
            except:
                camdname = None
        #Pli
        elif fileExists("/etc/init.d/softcam") or fileExists("/etc/init.d/cardserver"):
            try:
                camdname = open("/etc/init.d/softcam", "r")
            except:
                camdname = None
            try:
                cardname = open("/etc/init.d/cardserver", "r")
            except:
                cardname = None
        elif fileExists("/etc/.emustart"):
            try:
                camdname = open("/etc/.emustart", "r")
            except:
                camdname = None

        if cardname:
            for line in cardname:
                info2 = ""
                if 'oscam' in line.lower():
                    info2 = 'oscam'
                elif 'newcs' in line.lower():
                    info2 = 'newcs'
                elif 'wicard' in line.lower():
                    info2 = 'wicardd'
                elif 'cccam' in line.lower():
                    info2 = 'cccam'
            cardname.close()
        if camdname:
            camdlist = camdname
        if camdlist:
            info = 'unknow'
            if nofile:
                if nofile:
                    line = camdlist
            else:
                for line in camdlist:
                    if 'mgcamd' in line.lower() and 'oscam' in line.lower():
                        info = 'oscammgcamd'
                        break
                    if 'cccam' in line.lower() and 'oscam' in line.lower():
                        info = 'oscamcccam'
                        break
                    elif 'mgcamd' in line.lower():
                        info = 'mgcamd'
                    elif 'oscam' in line.lower():
                        info = 'oscam'
                    elif 'wicard' in line.lower():
                        info = 'wicardd'
                    elif 'cccam' in line.lower():
                        info = 'cccam'
                    elif 'camd3' in line.lower():
                        info = 'camd3'
                    elif 'evocamd' in line.lower():
                        info = 'evocamd'
                    elif 'newcs' in line.lower():
                        info = 'newcs'
                    elif 'rqcamd' in line.lower():
                        info = 'rqcamd'
                    elif 'gbox' in line.lower():
                        info = 'gbox'
                    elif 'mpcs' in line.lower():
                        info = 'mpcs'
                    elif 'sbox' in line.lower():
                        info = 'sbox'
                    elif 'scam' in line.lower():
                        info = 'scam'
        if camdname and not nofile:
            camdname.close()
        return info2 + info