Ejemplo n.º 1
0
def sessionstart(reason, **kwargs):                                               
	if reason == 0 and "session" in kwargs:                                                        
		if os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/WebChilds/Toplevel.py"):
			from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
			addExternalChild( ("fb", FacebookWebAuth(), "Facebook", "1", True) )          
		else:                                                                                  
			print "[Facebook] Webif not found"
Ejemplo n.º 2
0
def autostart(reason, **kwargs):
	if reason == 0:
		if kwargs.has_key("session"):
			session = kwargs["session"]
			vps_timers.session = session
			vps_timers.checkNextAfterEventAuto()
			vps_timers.checkTimer()

			try:
				from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
				from Plugins.Extensions.WebInterface.WebChilds.Screenpage import ScreenPage
				from twisted.web import static
				from twisted.python import util
				from enigma import eEnv
			except ImportError as ie:
				pass
			else:
				if hasattr(static.File, 'render_GET'):
					class File(static.File):
						def render_POST(self, request):
							return self.render_GET(request)
				else:
					File = static.File

				root = File(eEnv.resolve("${libdir}/enigma2/python/Plugins/SystemPlugins/vps/web-data"))
				root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True))
				addExternalChild(("vpsplugin", root, "VPS-Plugin", "1", False))
		else:
			register_vps()
	
	elif reason == 1:
		vps_timers.shutdown()
Ejemplo n.º 3
0
def autostart(reason, **kwargs):
	if "session" in kwargs:
		session = kwargs["session"]
		root = File(eEnv.resolve("${libdir}/enigma2/python/Plugins/Extensions/WebBouquetEditor/web-data"))
		root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True) )
		root.putChild('tmp', File('/tmp'))
		root.putChild("uploadfile",WebUploadResource(session))
		addExternalChild( ("bouqueteditor", root, "BouquetEditor", 1, True) )
Ejemplo n.º 4
0
	def render_GET(self, req):
        	req.setResponseCode(http.OK)
        	req.setHeader('Content-type', 'text/html')
        	req.setHeader('charset', 'UTF-8')
        	html = header_string
        	addExternalChild(('%sstart' % info, FactoryGui(info)))
                html += '<center>Set Factory Reset and start new!<a href="%skill" target="_self"><input type="submit" value="Reset"></a><p></p><p></p></center>' % (info)
                html += '<center>Nothing Change and back!<a href="javascript:location.reload()" target="_top"><input type="submit" value="back"></a></center>'
        	return html
Ejemplo n.º 5
0
def sessionstart(reason, **kwargs):
    if reason == 0 and "session" in kwargs:
        if os.path.exists(
                "/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/WebChilds/Toplevel.py"
        ):
            from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
            addExternalChild(("fb", FacebookWebAuth(), "Facebook", "1", True))
        else:
            print "[Facebook] Webif not found"
Ejemplo n.º 6
0
def autostart(reason, session=None, **kwargs):
    global _session
    if reason == 0 and _session is None:
        if session is not None:
            epgrefresh.session = session
            _session = session
            if config.plugins.epgrefresh.enabled.value:
                timeCallback(isCallback=False)
            if config.plugins.epgrefresh_extra.autorestore_backup.value:
                restore_backup = config.misc.epgcache_filename.value + ".backup"
                if os.path.exists(restore_backup):
                    try:
                        os.system("cp -f %s %s" %
                                  (restore_backup,
                                   config.misc.epgcache_filename.value))
                        if os.path.exists(config.misc.epgcache_filename.value):
                            os.chmod(
                                "%s" % (config.misc.epgcache_filename.value),
                                0644)
                    except:
                        pass
            if os.path.exists(
                    "/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/pluginshook.src"
            ):
                try:
                    from EPGRefreshResource import \
                      EPGRefreshStartRefreshResource, \
                      EPGRefreshAddRemoveServiceResource, \
                      EPGRefreshListServicesResource, \
                      EPGRefreshChangeSettingsResource, \
                      EPGRefreshSettingsResource, \
                      EPGRefreshPreviewServicesResource, \
                      API_VERSION
                    root = EPGRefreshListServicesResource()
                    root.putChild("refresh", EPGRefreshStartRefreshResource())
                    root.putChild(
                        "add",
                        EPGRefreshAddRemoveServiceResource(
                            EPGRefreshAddRemoveServiceResource.TYPE_ADD))
                    root.putChild(
                        "del",
                        EPGRefreshAddRemoveServiceResource(
                            EPGRefreshAddRemoveServiceResource.TYPE_DEL))
                    root.putChild("set", EPGRefreshChangeSettingsResource())
                    root.putChild("get", EPGRefreshSettingsResource())
                    root.putChild("preview",
                                  EPGRefreshPreviewServicesResource())
                    from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
                    addExternalChild(
                        ("epgrefresh", root, "EPGRefresh-Plugin", API_VERSION))
                    print("[EPGRefresh] Use OpenWebif")
                except:
                    print("[EPGRefresh] Error use OpenWebif")
    elif reason == 1:
        epgrefresh.stop()
Ejemplo n.º 7
0
def autostart(reason,**kwargs):
	if "session" in kwargs:
		sss = StreamServerSeek(session = kwargs["session"])
		print "session %s" % sss

		root = File(eEnv.resolve("${libdir}/enigma2/python/Plugins/Extensions/StreamServerSeek/web-data"))
		root.putChild("web", ScreenPageCORS(kwargs["session"], util.sibpath(__file__, "web"), True) )
		root.putChild("stream", StreamResource(kwargs["session"]))
		root.putChild("proxy", ProxyResource(kwargs["session"]))
		root.putChild("vod", EncodingResourceWrapper(VodResource(kwargs["session"]), [M3u8GzipEncoderFactory()]))
		addExternalChild( ("streamserverseek", root) )
Ejemplo n.º 8
0
	def render_GET(self, req):
        	req.setResponseCode(http.OK)
        	req.setHeader('Content-type', 'text/html')
        	req.setHeader('charset', 'UTF-8')
        	html = header_string
        	addExternalChild(('%sstart' % info, KeymapGui(info)))
        	#Keymaps = '<a href="%skill" target="_self">Change and Guirestart</a></form>' % (info)
         	#html += '<center><table style="width: 80%%;table-layout: fixed;" border="1" cellspacing="0"><tr><td align="left">%s:</td><td align="right">%s</td></tr></center>' % (info, Keymaps)
                html += '<center>Change Keymap and Restart Gui!<a href="%skill" target="_self"><input type="submit" value="Change"></a><p></p><p></p></center>' % (info)
                html += '<center>Nothing Change and back!<a href="javascript:location.reload()" target="_top"><input type="submit" value="back"></a></center>'
        	return html
Ejemplo n.º 9
0
	def render_GET(self, req):
        	req.setResponseCode(http.OK)
        	req.setHeader('Content-type', 'text/html')
        	req.setHeader('charset', 'UTF-8')
        	html = header_string
        	for info in infoList:
        		if info == self.input:        	
        			addExternalChild(('%sstart' % info, ImageReboot(info)))
                		html += '<center>Boot Image now?!<a href="%skill" target="_self"><input type="submit" value="Boot"></a><p></p><p></p></center>' % (info)
                		html += '<center>Boot Image by next reboot!<a href="javascript:location.reload()" target="_top"><input type="submit" value="back"></a></center>'
        	return html        	
Ejemplo n.º 10
0
def autostart(reason, **kwargs):
    if "session" in kwargs:
        print "[StreamserverSeek] init"
        session = kwargs["session"]
        root = File(
            eEnv.resolve(
                "${libdir}/enigma2/python/Plugins/Extensions/StreamServerSeek/web-data"
            ))
        root.putChild("web",
                      ScreenPage(session, util.sibpath(__file__, "web"), True))
        addExternalChild(("streamserverseek", root))
Ejemplo n.º 11
0
def sessionstart(reason, **kwargs):
    if reason == 0 and "session" in kwargs:

        try:
            from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
            root = APIRoot()
            root.putChild("call", APICallResource())
            root.putChild("getSubAPITree", APIgetSubAPITreeResource())
            root.putChild("getFunctionTree", APIgetFunctionTree())
            addExternalChild(("api", root, "JSON-RPC API", api.version, False))
        except Exception as e:
            print "--------------------- JSON WEB API !!!NOT!!! AVAILABLE!\n%s" % e
Ejemplo n.º 12
0
def sessionstart(reason, **kwargs):
	if reason == 0 and "session" in kwargs:
		
		try:
			from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
			root = APIRoot()
			root.putChild("call", APICallResource())
			root.putChild("getSubAPITree", APIgetSubAPITreeResource())
			root.putChild("getFunctionTree", APIgetFunctionTree())
			addExternalChild(("api", root, "JSON-RPC API", api.version, False))
		except Exception as e:
			print "--------------------- JSON WEB API !!!NOT!!! AVAILABLE!\n%s" %e
Ejemplo n.º 13
0
def autostart(reason, **kwargs):
    if "session" in kwargs:
        session = kwargs["session"]
        root = File(
            eEnv.resolve(
                "${libdir}/enigma2/python/Plugins/Extensions/WebBouquetEditor/web-data"
            ))
        root.putChild("web",
                      ScreenPage(session, util.sibpath(__file__, "web"), True))
        root.putChild('tmp', File('/tmp'))
        root.putChild("uploadfile", WebUploadResource(session))
        addExternalChild(("bouqueteditor", root, "BouquetEditor", 1, True))
Ejemplo n.º 14
0
def autostart(reason, **kwargs):
    if reason == 0 and "session" in kwargs:
        session = kwargs["session"]
        root = File(eEnv.resolve("${libdir}/enigma2/python/Plugins/Extensions/WebAdmin/web-data"))
        root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True))
        root.putChild("mobile", ScreenPage(session, util.sibpath(__file__, "mobile"), True))
        root.putChild("tmp", File("/tmp"))
        root.putChild("uploadtext", UploadTextResource())
        root.putChild("uploadpkg", UploadPkgResource())
        root.putChild("pkg", PKGResource())
        root.putChild("script", Script())
        addExternalChild(("webadmin", root, "WebAdmin", 1, True, "_self"))
Ejemplo n.º 15
0
def autostart(reason, **kwargs):
    if reason == 0:
        if kwargs.has_key("session"):
            session = kwargs["session"]
            vps_timers.session = session
            vps_timers.checkTimer()

            try:
                from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
                from Plugins.Extensions.WebInterface.WebChilds.Screenpage import ScreenPage
                from twisted.web import static
                from twisted.python import util
                from enigma import eEnv
            except ImportError as ie:
                pass
            else:
                if hasattr(static.File, 'render_GET'):

                    class File(static.File):
                        def render_POST(self, request):
                            return self.render_GET(request)
                else:
                    File = static.File

                root = File(
                    eEnv.resolve(
                        "${libdir}/enigma2/python/Plugins/SystemPlugins/vps/web-data"
                    ))
                root.putChild(
                    "web",
                    ScreenPage(session, util.sibpath(__file__, "web"), True))
                addExternalChild(("vpsplugin", root, "VPS-Plugin", "1", False))
        else:
            register_vps()

    elif reason == 1:
        vps_timers.shutdown()

        try:
            if config.plugins.vps.wakeup_time.value != -1 and config.plugins.vps.wakeup_time.value == config.misc.prev_wakeup_time.value:
                # Folgendes wird nur wegen spezieller Anforderungen des Plugins gesetzt.
                # Damit sich Enigma2 so verhält, wie wenn es für eine Aufnahme aus dem Standby aufwacht.
                config.misc.prev_wakeup_time_type.value = 0
                config.misc.prev_wakeup_time_type.save()
                config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto
                config.misc.isNextRecordTimerAfterEventActionAuto.save()

                # Da E2 die Configdatei noch vor dem Aufruf von autostart shutdown abspeichert, muss hier nochmal abgespeichert werden.
                configfile.save()

        except:
            print "[VPS-Plugin] exception in shutdown handler, probably old enigma2"
Ejemplo n.º 16
0
	def render_GET(self, req):
		global infoList
        	change = '<input style="color&#58;#00b000;" type="submit" value="FactoryReset">'
        	req.setResponseCode(http.OK)
        	req.setHeader('Content-type', 'text/html')
        	req.setHeader('charset', 'UTF-8')
        	infoList = checkFactory(None)
        	html = header_string        	
       		for info in infoList:
      	    		addExternalChild(('%sstart' % info, FactoryCP(info)))
       	    		Factorys = '<a href="%sstart" target="_self">%s</a></form>' % (info, change)
       	    		html += '<center><table style="width: 80%%;table-layout: fixed;" border="1" cellspacing="0"><tr><td align="left">%s:</td><td align="right">%s</td></tr></center>' % (info, Factorys)
                return html
Ejemplo n.º 17
0
def autostart(reason, **kwargs):
	global session
	from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
	from FC2webSite import FC2web, FC2webLog, FC2webChart
	from twisted.web import static
	root = static.File("/usr/lib/enigma2/python/Plugins/Extensions/FanControl2/data")
#	root = FC2web()
	root.putChild("", FC2web())
	root.putChild("log", FC2webLog())
	root.putChild("chart", FC2webChart())
	addExternalChild( ("fancontrol", root) )
	if reason == 0 and kwargs.has_key("session"):
		session = kwargs["session"]
		session.open(FanControl2)
Ejemplo n.º 18
0
def sessionstart(reason, **kwargs):
    if reason == 0 and "session" in kwargs:
        try:
            from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
            from Plugins.Extensions.WebInterface.WebChilds.Screenpage import ScreenPage
            from twisted.web import static
            from twisted.python import util
            from WebChilds.UploadResource import UploadResource

            from AutoTimerResource import AutoTimerDoParseResource, \
             AutoTimerListAutoTimerResource, AutoTimerAddOrEditAutoTimerResource, \
             AutoTimerRemoveAutoTimerResource, AutoTimerChangeSettingsResource, \
             AutoTimerSettingsResource, AutoTimerSimulateResource, AutoTimerTestResource, \
             AutoTimerUploadXMLConfigurationAutoTimerResource, AutoTimerAddXMLAutoTimerResource, API_VERSION
        except ImportError as ie:
            pass
        else:
            if hasattr(static.File, 'render_GET'):

                class File(static.File):
                    def render_POST(self, request):
                        return self.render_GET(request)
            else:
                File = static.File

            # webapi
            root = AutoTimerListAutoTimerResource()
            root.putChild('parse', AutoTimerDoParseResource())
            root.putChild('remove', AutoTimerRemoveAutoTimerResource())
            root.putChild('upload_xmlconfiguration',
                          AutoTimerUploadXMLConfigurationAutoTimerResource())
            root.putChild('add_xmltimer', AutoTimerAddXMLAutoTimerResource())
            root.putChild('edit', AutoTimerAddOrEditAutoTimerResource())
            root.putChild('get', AutoTimerSettingsResource())
            root.putChild('set', AutoTimerChangeSettingsResource())
            root.putChild('simulate', AutoTimerSimulateResource())
            root.putChild('test', AutoTimerTestResource())
            addExternalChild(
                ("autotimer", root, "AutoTimer-Plugin", API_VERSION, False))

            # webgui
            session = kwargs["session"]
            root = File(util.sibpath(__file__, "web-data"))
            root.putChild(
                "web", ScreenPage(session, util.sibpath(__file__, "web"),
                                  True))
            root.putChild('tmp', File('/tmp'))
            root.putChild("uploadfile", UploadResource(session))
            addExternalChild(("autotimereditor", root, "AutoTimer", "1", True))
Ejemplo n.º 19
0
def autostart(reason, **kwargs):
	if reason == 0 and "session" in kwargs:
		session = kwargs["session"]
		if getProc("shellinaboxd"):
			copyfile(tpl_dir + "tplTerminal.htm.shellinabox", tpl_dir + "tplTerminal.htm")
		else:
			copyfile(tpl_dir + "tplTerminal.htm.default", tpl_dir + "tplTerminal.htm")
		root = File(eEnv.resolve("${libdir}/enigma2/python/Plugins/Extensions/WebAdmin/web-data"))
		root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True) )
		root.putChild("mobile", ScreenPage(session, util.sibpath(__file__, "mobile"), True) )
		root.putChild('tmp', File('/tmp'))
		root.putChild("uploadtext", UploadTextResource())
		root.putChild("uploadpkg", UploadPkgResource())
		root.putChild("pkg", PKGResource())
		root.putChild("script", Script())
		addExternalChild( ("webadmin", root, "WebAdmin", 1, True, "_self") )
Ejemplo n.º 20
0
def sessionstart(reason, **kwargs):
	if reason == 0 and "session" in kwargs:
		from WebChilds.UploadResource import UploadResource
		if hasattr(static.File, 'render_GET'):
			class File(static.File):
				def render_POST(self, request):
					return self.render_GET(request)
		else:
			File = static.File

		session = kwargs["session"]
		root = File(util.sibpath(__file__, "web-data"))
		root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True) )
		root.putChild('tmp', File('/tmp'))
		root.putChild("uploadfile", UploadResource(session))
		addExternalChild( ("autotimereditor", root, "AutoTimer", "1", True) )
Ejemplo n.º 21
0
def autostart(reason, **kwargs):
	if reason == 0:
		if kwargs.has_key("session"):
			session = kwargs["session"]
			vps_timers.session = session
			vps_timers.checkTimer()

			try:
				from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
				from Plugins.Extensions.WebInterface.WebChilds.Screenpage import ScreenPage
				from twisted.web import static
				from twisted.python import util
				from enigma import eEnv
			except ImportError as ie:
				pass
			else:
				if hasattr(static.File, 'render_GET'):
					class File(static.File):
						def render_POST(self, request):
							return self.render_GET(request)
				else:
					File = static.File

				root = File(eEnv.resolve("${libdir}/enigma2/python/Plugins/SystemPlugins/vps/web-data"))
				root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True))
				addExternalChild(("vpsplugin", root, "VPS-Plugin", "1", False))
		else:
			register_vps()

	elif reason == 1:
		vps_timers.shutdown()

		try:
			if config.plugins.vps.wakeup_time.value != -1 and config.plugins.vps.wakeup_time.value == config.misc.prev_wakeup_time.value:
				# Folgendes wird nur wegen spezieller Anforderungen des Plugins gesetzt.
				# Damit sich Enigma2 so verhält, wie wenn es für eine Aufnahme aus dem Standby aufwacht.
				config.misc.prev_wakeup_time_type.value = 0
				config.misc.prev_wakeup_time_type.save()
				config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto
				config.misc.isNextRecordTimerAfterEventActionAuto.save()

				# Da E2 die Configdatei noch vor dem Aufruf von autostart shutdown abspeichert, muss hier nochmal abgespeichert werden.
				configfile.save()

		except:
			print "[VPS-Plugin] exception in shutdown handler, probably old enigma2"
Ejemplo n.º 22
0
	def render_GET(self, req):
		global infoList
        	booten = '<input style="color&#58;#00b000;" type="submit" value="Booten">'
        	req.setResponseCode(http.OK)
        	req.setHeader('Content-type', 'text/html')
        	req.setHeader('charset', 'UTF-8')
        	infoList = checkImages(None)
        	html = header_string
        	if  "no Multiboot Installed!" in infoList:
                        html += '<center><table style="width: 100%%;table-layout: fixed;" border="0" cellspacing="0"><tr><td align="left">NO MultiBoot Installed</td></tr></center>'
                        self.finished()
                else: 
        		for info in infoList:
       		    		addExternalChild(('%sstart' % info, ImageStart(info)))
        	    		Images = '<a href="%sstart" target="_self">%s</a></form>' % (info, booten)
         	    		html += '<center><table style="width: 80%%;table-layout: fixed;" border="1" cellspacing="0"><tr><td align="left">%s:</td><td align="right">%s</td></tr></center>' % (info, Images)
                return html
Ejemplo n.º 23
0
def autostart(reason, **kwargs):
	global session
	if os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/webif.py"):
		from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
		from FC2webSite import FC2web, FC2webLog, FC2webChart
		from twisted.web import static
		root = static.File("/usr/lib/enigma2/python/Plugins/Extensions/FanControl2/data")
#		root = FC2web()
		root.putChild("", FC2web())
		root.putChild("log", FC2webLog())
		root.putChild("chart", FC2webChart())
		addExternalChild( ("fancontrol", root) )
	if not os.path.exists("/proc/stb/fp/fan_vlt"):
		FClog("not supported, exit")
		return
	if reason == 0 and kwargs.has_key("session"):
		session = kwargs["session"]
		session.open(FanControl2)
Ejemplo n.º 24
0
def autostart(reason, **kwargs):
    if reason == 0 and "session" in kwargs:
        session = kwargs["session"]
        root = File(
            eEnv.resolve(
                "${libdir}/enigma2/python/Plugins/Extensions/WebAdmin/web-data"
            ))
        root.putChild("web",
                      ScreenPage(session, util.sibpath(__file__, "web"), True))
        root.putChild(
            "mobile",
            ScreenPage(session, util.sibpath(__file__, "mobile"), True))
        root.putChild('tmp', File('/tmp'))
        root.putChild("uploadtext", UploadTextResource())
        root.putChild("uploadpkg", UploadPkgResource())
        root.putChild("pkg", PKGResource())
        root.putChild("script", Script())
        addExternalChild(("webadmin", root, "WebAdmin", 1, True, "_self"))
Ejemplo n.º 25
0
def sessionstart(reason, **kwargs):
	if reason == 0 and "session" in kwargs:
		try:
			from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
			from Plugins.Extensions.WebInterface.WebChilds.Screenpage import ScreenPage
			from twisted.web import static
			from twisted.python import util
			from WebChilds.UploadResource import UploadResource

			from AutoTimerResource import AutoTimerDoParseResource, \
				AutoTimerListAutoTimerResource, AutoTimerAddOrEditAutoTimerResource, \
				AutoTimerRemoveAutoTimerResource, AutoTimerChangeSettingsResource, \
				AutoTimerSettingsResource, AutoTimerSimulateResource, AutoTimerTestResource, \
				AutoTimerUploadXMLConfigurationAutoTimerResource, AutoTimerAddXMLAutoTimerResource, API_VERSION
		except ImportError as ie:
			pass
		else:
			if hasattr(static.File, 'render_GET'):
				class File(static.File):
					def render_POST(self, request):
						return self.render_GET(request)
			else:
				File = static.File

			# webapi
			root = AutoTimerListAutoTimerResource()
			root.putChild('parse', AutoTimerDoParseResource())
			root.putChild('remove', AutoTimerRemoveAutoTimerResource())
			root.putChild('upload_xmlconfiguration', AutoTimerUploadXMLConfigurationAutoTimerResource())
			root.putChild('add_xmltimer', AutoTimerAddXMLAutoTimerResource())
			root.putChild('edit', AutoTimerAddOrEditAutoTimerResource())
			root.putChild('get', AutoTimerSettingsResource())
			root.putChild('set', AutoTimerChangeSettingsResource())
			root.putChild('simulate', AutoTimerSimulateResource())
			root.putChild('test', AutoTimerTestResource())
			addExternalChild( ("autotimer", root , "AutoTimer-Plugin", API_VERSION, False) )

			# webgui
			session = kwargs["session"]
			root = File(util.sibpath(__file__, "web-data"))
			root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True) )
			root.putChild('tmp', File('/tmp'))
			root.putChild("uploadfile", UploadResource(session))
			addExternalChild( ("autotimereditor", root, "AutoTimer", "1", True) )
Ejemplo n.º 26
0
def sessionstart(reason, **kwargs):
	if reason == 0 and "session" in kwargs:
		try:
			from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
			from Plugins.Extensions.WebInterface.WebChilds.Screenpage import ScreenPage
			from twisted.python import util
			from twisted.web import static
			if hasattr(static.File, 'render_GET'):
				class File(static.File):
					def render_POST(self, request):
						return self.render_GET(request)
			else:
				File = static.File
			session = kwargs["session"]
			root = File(util.sibpath(__file__, "web-data"))
			root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True))
			addExternalChild( ("internetradio", root, "Internet-Radio", "1", True) )
		except ImportError:
			pass # pah!
Ejemplo n.º 27
0
def autostart(reason, session=None, **kwargs):
	global _session
	if reason == 0 and _session is None:
		if session is not None:
			epgrefresh.session = session
			_session = session
			if config.plugins.epgrefresh.enabled.value:
				timeCallback(isCallback=False)
			if config.plugins.epgrefresh_extra.autorestore_backup.value:
				restore_backup = config.misc.epgcache_filename.value + ".backup"
				if os.path.exists(restore_backup):
					try:
						os.system("cp -f %s %s" % (restore_backup, config.misc.epgcache_filename.value ))
						if os.path.exists(config.misc.epgcache_filename.value): 
							os.chmod("%s" % (config.misc.epgcache_filename.value), 0644)
					except:
						pass
			if os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/pluginshook.src"):
				try:
					from EPGRefreshResource import \
							EPGRefreshStartRefreshResource, \
							EPGRefreshAddRemoveServiceResource, \
							EPGRefreshListServicesResource, \
							EPGRefreshChangeSettingsResource, \
							EPGRefreshSettingsResource, \
							EPGRefreshPreviewServicesResource, \
							API_VERSION
					root = EPGRefreshListServicesResource()
					root.putChild("refresh", EPGRefreshStartRefreshResource())
					root.putChild("add", EPGRefreshAddRemoveServiceResource(EPGRefreshAddRemoveServiceResource.TYPE_ADD))
					root.putChild("del", EPGRefreshAddRemoveServiceResource(EPGRefreshAddRemoveServiceResource.TYPE_DEL))
					root.putChild("set", EPGRefreshChangeSettingsResource())
					root.putChild("get", EPGRefreshSettingsResource())
					root.putChild("preview", EPGRefreshPreviewServicesResource())
					from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
					addExternalChild( ("epgrefresh", root, "EPGRefresh-Plugin", API_VERSION) )
					print("[EPGRefresh] Use OpenWebif")
				except:
					print("[EPGRefresh] Error use OpenWebif")
	elif reason == 1:
		epgrefresh.stop()
Ejemplo n.º 28
0
def autostart(reason, **kwargs):
	global session
	if reason == 0 and kwargs.has_key("session"):
		if os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/__init__.pyo") or os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/__init__.pyo"):
			from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
			from FC2webSite import FC2web, FC2webLog, FC2webChart
			from twisted.web import static
			root = static.File("/usr/lib/enigma2/python/Plugins/Extensions/FanControl2/data")
#			root = FC2web()
			root.putChild("", FC2web())
			root.putChild("log", FC2webLog())
			root.putChild("chart", FC2webChart())
			if os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web/external.xml") or os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/__init__.pyo"):
				addExternalChild( ("fancontrol", root, "Fan Control 2", Version, True) )
			else:
				addExternalChild( ("fancontrol", root) )
		if not os.path.exists("/proc/stb/fp/fan_vlt"):
			Notifications.AddNotification(MessageBox, _("Box has no fancontrol hardware -> FC2 deactivated"), type=MessageBox.TYPE_INFO, timeout=10)
			FClog("not supported, exit")
			return
		session = kwargs["session"]
		session.open(FanControl2)
Ejemplo n.º 29
0
def sessionstart(reason, **kwargs):
    if reason == 0 and "session" in kwargs:
        try:
            from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
            from Plugins.Extensions.WebInterface.WebChilds.Screenpage import ScreenPage
            from twisted.python import util
            from twisted.web import static
            if hasattr(static.File, 'render_GET'):

                class File(static.File):
                    def render_POST(self, request):
                        return self.render_GET(request)
            else:
                File = static.File
            session = kwargs["session"]
            root = File(util.sibpath(__file__, "web-data"))
            root.putChild(
                "web", ScreenPage(session, util.sibpath(__file__, "web"),
                                  True))
            addExternalChild(
                ("internetradio", root, "Internet-Radio", "1", True))
        except ImportError:
            pass  # pah!
Ejemplo n.º 30
0
	def render_GET(self, req):
		global infoList
		root = os.path.join(eEnv.resolve("${datadir}"),"enigma2")
        	change = '<input style="color&#58;#00b000;" type="submit" value="Change Skin">'
        	req.setResponseCode(http.OK)
        	req.setHeader('Content-type', 'text/html')
        	req.setHeader('charset', 'UTF-8')
        	infoList = checkSkin(None)
        	html = header_string        	
        	#if  "no Backgroundimage found!" in infoList:
                #        html += '<center><table style="width: 100%%;table-layout: fixed;" border="0" cellspacing="0"><tr><td align="left">NO Backgroundimage found</td></tr></center>'
                #        self.finished()
                #else: 
        	for info in infoList:
       			addExternalChild(('%sstart' % info, SkinSel(info)))
       			print "info=", info
       			if info == "Default":
       				pngpath = "/web-data/skin/default.png"
       			else:	
          			pngpath = "/web-data/skin/" + info + ".png"
      			Images = '<a href="%sstart" target="_self">%s</a></form>' % (info, change)
         		html += '<center><table style="width: 80%%;table-layout: fixed;" border="0" cellspacing="0"><tr><td align="left">%s:</td><td><img src="%s" width="100%%" height="100%%" align="left"></td><td align="right">%s</td></tr></center>' % (info, pngpath, Images) 
        
                return html
Ejemplo n.º 31
0
from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
from Plugins.Extensions.FanControl.FC2webSite import FC2web, FC2webLog, FC2webChart
root = FC2web()
root.putChild("log", FC2webLog())
root.putChild("chart", FC2webChart())
addExternalChild( ("fancontrol", root) )
Ejemplo n.º 32
0
from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerDoParseResource, \
 AutoTimerListAutoTimerResource, AutoTimerAddOrEditAutoTimerResource, \
 AutoTimerRemoveAutoTimerResource, AutoTimerChangeSettingsResource, \
 AutoTimerSettingsResource, API_VERSION

root = AutoTimerListAutoTimerResource()
root.putChild('parse', AutoTimerDoParseResource())
root.putChild('remove', AutoTimerRemoveAutoTimerResource())
root.putChild('edit', AutoTimerAddOrEditAutoTimerResource())
root.putChild('get', AutoTimerSettingsResource())
root.putChild('set', AutoTimerChangeSettingsResource())
addExternalChild(("autotimer", root, "AutoTimer-Plugin", API_VERSION))
Ejemplo n.º 33
0
	def __init__(self, input):
	        self.Console = Console()
	        self.imagestartcmd = ""
        	self.container = eConsoleAppContainer()
        	self.container.appClosed.append(self.finished)
        	self.input = input
    
	def render_GET(self, req):
        	req.setResponseCode(http.OK)
        	req.setHeader('Content-type', 'text/html')
        	req.setHeader('charset', 'UTF-8')
        	html = header_string
        	for info in infoList:
        		if info == self.input:
        		        config.usage.keymap.setValue(eEnv.resolve("${datadir}/enigma2/" + self.input))
        		        config.usage.keymap.save()
        		        configfile.save()
        		        quitMainloop(3)
                		continue
        		html += '<p></p>'
        	return html

	def finished(self, retval):
        	print 'finished', retval

addExternalChild(('KeymapChange', KeymapChange()))
infoList = checkKeymap(None)
for info in infoList:
	addExternalChild(('%sstart' % info, KeymapCP(info)))
	addExternalChild(('%skill' % info, KeymapGui(info)))
Ejemplo n.º 34
0
        if data.find('fancontrol') > 0 and data.find('iptvplayer') < 0:
            ret = True
            data = None
    except Exception:
        pass

    data = None
    return ret


# registration for old webinterface
if os.path.exists(
        resolveFilename(SCOPE_PLUGINS,
                        'Extensions/WebInterface/web/external.xml')):
    try:
        addExternalChild(("e2iplayer", IPTVwebRoot, "E2iPlayer",
                          settings.WebInterfaceVersion, True))
        addExternalChild(("iptvplayer", IPTVwebRoot, "E2iPlayer",
                          settings.WebInterfaceVersion, True))
    except Exception:
        addExternalChild(("e2iplayer", IPTVwebRoot))
        addExternalChild(("iptvplayer", IPTVwebRoot))
# registration for openwebif
elif os.path.exists(
        resolveFilename(SCOPE_PLUGINS,
                        'Extensions/OpenWebif/pluginshook.src')):
    # Old openwebif version (prior July the 14th 2017) has a bug and does not populate links to all properly registered web addons except fancontrol
    # see: https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/pull/629
    #  A HACK: we will canibalize fancontrol entry point (if not installed) to present IPTVplayer option on the web
    if checkForFC() == True and not os.path.exists(
            resolveFilename(SCOPE_PLUGINS,
                            'Extensions/FanControl2/FC2webSite.pyo')):
Ejemplo n.º 35
0
def sessionstart(reason, **kwargs):
    if reason == 0 and "session" in kwargs:
        # try:
        # 	AutoTimerGraphMultiEPGInit()
        # except:
        # 	pass
        try:
            AutoTimerChannelContextMenuInit()
        except:
            pass
        try:
            AutoTimerEPGSelectionInit()
        except:
            pass
        if isOriginalWebifInstalled():
            try:
                from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
                from Plugins.Extensions.WebInterface.WebChilds.Screenpage import ScreenPage
                from twisted.web import static
                from twisted.python import util
                from WebChilds.UploadResource import UploadResource

                from AutoTimerResource import (
                    AutoTimerDoParseResource,
                    AutoTimerListAutoTimerResource,
                    AutoTimerAddOrEditAutoTimerResource,
                    AutoTimerRemoveAutoTimerResource,
                    AutoTimerChangeSettingsResource,
                    AutoTimerSettingsResource,
                    AutoTimerSimulateResource,
                    AutoTimerTestResource,
                    API_VERSION,
                )
            except ImportError as ie:
                pass
            else:
                if hasattr(static.File, "render_GET"):

                    class File(static.File):
                        def render_POST(self, request):
                            return self.render_GET(request)

                else:
                    File = static.File

                    # webapi
                root = AutoTimerListAutoTimerResource()
                root.putChild("parse", AutoTimerDoParseResource())
                root.putChild("remove", AutoTimerRemoveAutoTimerResource())
                root.putChild("edit", AutoTimerAddOrEditAutoTimerResource())
                root.putChild("get", AutoTimerSettingsResource())
                root.putChild("set", AutoTimerChangeSettingsResource())
                root.putChild("simulate", AutoTimerSimulateResource())
                root.putChild("test", AutoTimerTestResource())
                addExternalChild(("autotimer", root, "AutoTimer-Plugin", API_VERSION, False))

                # webgui
                session = kwargs["session"]
                root = File(util.sibpath(__file__, "web-data"))
                root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True))
                root.putChild("tmp", File("/tmp"))
                root.putChild("uploadfile", UploadResource(session))
                addExternalChild(("autotimereditor", root, "AutoTimer", "1", True))
                doLog("[AutoTimer] Use WebInterface")
        else:
            if isOpenWebifInstalled():
                try:
                    from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
                    from AutoTimerResource import (
                        AutoTimerDoParseResource,
                        AutoTimerListAutoTimerResource,
                        AutoTimerAddOrEditAutoTimerResource,
                        AutoTimerRemoveAutoTimerResource,
                        AutoTimerChangeSettingsResource,
                        AutoTimerSettingsResource,
                        AutoTimerSimulateResource,
                        AutoTimerTestResource,
                        API_VERSION,
                    )
                except ImportError as ie:
                    pass
                else:
                    root = AutoTimerListAutoTimerResource()
                    root.putChild("parse", AutoTimerDoParseResource())
                    root.putChild("remove", AutoTimerRemoveAutoTimerResource())
                    root.putChild("edit", AutoTimerAddOrEditAutoTimerResource())
                    root.putChild("get", AutoTimerSettingsResource())
                    root.putChild("set", AutoTimerChangeSettingsResource())
                    root.putChild("simulate", AutoTimerSimulateResource())
                    root.putChild("test", AutoTimerTestResource())
                    addExternalChild(("autotimer", root, "AutoTimer-Plugin", API_VERSION))
                    doLog("[AutoTimer] Use OpenWebif")
		print str(e)
		pass
	else:
		if hasattr(static.File, 'render_GET'):
			class File(static.File):
				def render_POST(self, request):
					return self.render_GET(request)
		else:
			File = static.File

		# webapi
		(root, childs) = addWebInterfaceForOpenWebInterface()
		if childs:
			for name, api in childs:
				root.putChild(name, api)
		addExternalChild( ("serienrecorder", root , "SerienRecorder-Plugin", API_VERSION, False) )

		# webgui
		#session = kwargs["session"]
		#root = File(util.sibpath(__file__, "web-data"))
		#root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True) )
		#root.putChild('tmp', File('/tmp'))
		#root.putChild("uploadfile", UploadResource(session))
		#addExternalChild( ("autotimereditor", root, "AutoTimer", "1", True) )

def addWebInterfaceForOpenWebInterface():
	return getApiList()


class ApiBaseResource(resource.Resource):
	def returnResult(self, req, state, data):
Ejemplo n.º 37
0
from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
import os
if os.path.exists('/media/ba/BarryAllen/BarryAllen.py') == True:
   from Plugins.Extensions.BarryAllen.BarryAllen import BarryAllen
   addExternalChild( ("barryallen", BarryAllen()) )

Ejemplo n.º 38
0
		print str(e)
		pass
	else:
		if hasattr(static.File, 'render_GET'):
			class File(static.File):
				def render_POST(self, request):
					return self.render_GET(request)
		else:
			File = static.File

		# webapi
		(root, childs) = addWebInterfaceForOpenWebInterface()
		if childs:
			for name, api in childs:
				root.putChild(name, api)
		addExternalChild( ("serienrecorder", root , "SerienRecorder-Plugin", API_VERSION, False) )

		# webgui
		#session = kwargs["session"]
		#root = File(util.sibpath(__file__, "web-data"))
		#root.putChild("web", ScreenPage(session, util.sibpath(__file__, "web"), True) )
		#root.putChild('tmp', File('/tmp'))
		#root.putChild("uploadfile", UploadResource(session))
		#addExternalChild( ("autotimereditor", root, "AutoTimer", "1", True) )

def addWebInterfaceForOpenWebInterface():
	return getApiList()


class ApiBaseResource(resource.Resource):
	def returnResult(self, req, state, data):
Ejemplo n.º 39
0
from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
from Plugins.Extensions.EPGRefresh.EPGRefreshResource import \
  EPGRefreshStartRefreshResource, \
  EPGRefreshAddRemoveServiceResource, \
  EPGRefreshListServicesResource, \
  EPGRefreshChangeSettingsResource, \
  EPGRefreshSettingsResource, \
  EPGRefreshPreviewServicesResource, \
  API_VERSION

root = EPGRefreshListServicesResource()
root.putChild("refresh", EPGRefreshStartRefreshResource())
root.putChild(
    "add",
    EPGRefreshAddRemoveServiceResource(
        EPGRefreshAddRemoveServiceResource.TYPE_ADD))
root.putChild(
    "del",
    EPGRefreshAddRemoveServiceResource(
        EPGRefreshAddRemoveServiceResource.TYPE_DEL))
root.putChild("set", EPGRefreshChangeSettingsResource())
root.putChild("get", EPGRefreshSettingsResource())
root.putChild("preview", EPGRefreshPreviewServicesResource())
addExternalChild(("epgrefresh", root, "EPGRefresh-Plugin", API_VERSION))
Ejemplo n.º 40
0
        	self.container.appClosed.append(self.finished)
        	self.input = input
    
	def render_GET(self, req):
        	req.setResponseCode(http.OK)
        	req.setHeader('Content-type', 'text/html')
        	req.setHeader('charset', 'UTF-8')
        	html = header_string
                pluginpath = '/usr/lib/enigma2/python/Plugins/Extensions/NFR4XBoot'
                f = open(pluginpath + '/.nfr4xboot_location', 'r')
                mypath = f.readline().strip()
                f.close()   
        	files = mypath + "NFR4XBootI/.nfr4xboot"
        	out = open(files, 'w')
        	out.write(self.input)
        	out.close()
        	os.system('rm /tmp/.nfr4xreboot')
                os.system('touch /tmp/.nfr4xreboot')
                os.system('reboot -p')        	    
        	return html

	def finished(self, retval):
        	print 'finished', retval


addExternalChild(('MultibootControl', MultibootControl()))
infoList = checkImages(None)
for info in infoList:
	addExternalChild(('%sstart' % info, ImageStart(info)))
	addExternalChild(('%skill' % info, ImageReboot(info)))
Ejemplo n.º 41
0
def sessionstart(reason, **kwargs):
    if reason == 0 and "session" in kwargs:
        #try:
        #	AutoTimerGraphMultiEPGInit()
        #except:
        #	pass
        try:
            AutoTimerChannelContextMenuInit()
        except:
            pass
        try:
            AutoTimerEPGSelectionInit()
        except:
            pass
        if isOriginalWebifInstalled():
            try:
                from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
                from Plugins.Extensions.WebInterface.WebChilds.Screenpage import ScreenPage
                from twisted.web import static
                from twisted.python import util
                from WebChilds.UploadResource import UploadResource

                from AutoTimerResource import AutoTimerDoParseResource, \
                 AutoTimerListAutoTimerResource, AutoTimerAddOrEditAutoTimerResource, \
                 AutoTimerRemoveAutoTimerResource, AutoTimerChangeSettingsResource, \
                 AutoTimerSettingsResource, AutoTimerSimulateResource, API_VERSION
            except ImportError as ie:
                pass
            else:
                if hasattr(static.File, 'render_GET'):

                    class File(static.File):
                        def render_POST(self, request):
                            return self.render_GET(request)
                else:
                    File = static.File

                # webapi
                root = AutoTimerListAutoTimerResource()
                root.putChild('parse', AutoTimerDoParseResource())
                root.putChild('remove', AutoTimerRemoveAutoTimerResource())
                root.putChild('edit', AutoTimerAddOrEditAutoTimerResource())
                root.putChild('get', AutoTimerSettingsResource())
                root.putChild('set', AutoTimerChangeSettingsResource())
                root.putChild('simulate', AutoTimerSimulateResource())
                addExternalChild(("autotimer", root, "AutoTimer-Plugin",
                                  API_VERSION, False))

                # webgui
                session = kwargs["session"]
                root = File(util.sibpath(__file__, "web-data"))
                root.putChild(
                    "web",
                    ScreenPage(session, util.sibpath(__file__, "web"), True))
                root.putChild('tmp', File('/tmp'))
                root.putChild("uploadfile", UploadResource(session))
                addExternalChild(
                    ("autotimereditor", root, "AutoTimer", "1", True))
                print("[AutoTimer] Use WebInterface")
        else:
            if isOpenWebifInstalled():
                try:
                    from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
                    from AutoTimerResource import AutoTimerDoParseResource, \
                     AutoTimerListAutoTimerResource, AutoTimerAddOrEditAutoTimerResource, \
                     AutoTimerRemoveAutoTimerResource, AutoTimerChangeSettingsResource, \
                     AutoTimerSettingsResource, AutoTimerSimulateResource, API_VERSION
                except ImportError as ie:
                    pass
                else:
                    root = AutoTimerListAutoTimerResource()
                    root.putChild('parse', AutoTimerDoParseResource())
                    root.putChild('remove', AutoTimerRemoveAutoTimerResource())
                    root.putChild('edit',
                                  AutoTimerAddOrEditAutoTimerResource())
                    root.putChild('get', AutoTimerSettingsResource())
                    root.putChild('set', AutoTimerChangeSettingsResource())
                    root.putChild('simulate', AutoTimerSimulateResource())
                    addExternalChild(
                        ("autotimer", root, "AutoTimer-Plugin", API_VERSION))
                    print("[AutoTimer] Use OpenWebif")
from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerDoParseResource, \
 AutoTimerListAutoTimerResource

root = AutoTimerListAutoTimerResource()
root.putChild('parse', AutoTimerDoParseResource())
addExternalChild(("autotimer", root))
Ejemplo n.º 43
0
from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
from Plugins.Extensions.EPGRefresh.EPGRefreshResource import \
		EPGRefreshStartRefreshResource, \
		EPGRefreshAddRemoveServiceResource, \
		EPGRefreshListServicesResource, \
		EPGRefreshChangeSettingsResource, \
		EPGRefreshSettingsResource

root = EPGRefreshListServicesResource()
root.putChild("refresh", EPGRefreshStartRefreshResource())
root.putChild("add", EPGRefreshAddRemoveServiceResource(EPGRefreshAddRemoveServiceResource.TYPE_ADD))
root.putChild("del", EPGRefreshAddRemoveServiceResource(EPGRefreshAddRemoveServiceResource.TYPE_DEL))
root.putChild("set", EPGRefreshChangeSettingsResource())
root.putChild("get", EPGRefreshSettingsResource())
addExternalChild( ("epgrefresh", root) )

Ejemplo n.º 44
0
	def render_GET(self, req):
	        self.Console = Console()
		global infoList
		act_webif = False
        	infoList = checkCams(None)
        	aktiv = '<input style="background-color&#58;#00b000;" type="button" value="Aktiviert">'
        	webaktivieren = '<input style="color&#58;#00b000;" type="submit" value="Open Cam Webif">'
                aktivieren = '<input style="color&#58;#00b000;" type="submit" value="Aktivieren">'
        	deaktivieren = '<input style="color&#58;#FF0000;" type="submit" value="Deaktivieren">'
       		deaktiviert = '<input style="background-color&#58;#FF0000;" type="button" value="Deaktiviert">'
        	req.setResponseCode(http.OK)
        	req.setHeader('Content-type', 'text/html')
        	req.setHeader('charset', 'UTF-8')
        	self.activecam = False
        	self.actcam = config.NFRSoftcam.actcam.value
        	camconfigs = []
        	ps = subprocess.Popen(('ps', 'ax'), stdout=subprocess.PIPE)
        	output = ps.communicate()[0]
        	for line in output.split('\n'):
            	    if self.actcam in line:
                        t = line.find("keys")
                        t1 = len(line)
                        camconfigs.append(line[t:t1])
                        self.activecam = True
        	
                if self.activecam == False:
                    print "no Softcam Activ!"
                    #self.actcam = "None"
                else:
                    if 'doscam' in self.actcam:
                        searchfile = camconfigs[0] + '/doscam.cfg'
                    elif 'oscam' in self.actcam: 
                        searchfile = camconfigs[0] + '/oscam.conf' 
                    elif 'cccam' in self.actcam or 'CCcam' in self.actcam: 
                        searchfile = camconfigs[0]
                    if 'oscam' in self.actcam or 'doscam' in self.actcam or 'cccam' in self.actcam or 'CCcam' in self.actcam:
                        fdc = open('/usr/' + searchfile) 
                        zeilencfg = fdc.read().split('\n')
                        fdc.close()
                        for line in zeilencfg:
                            if line.startswith("WEBINFO") or line.startswith("httpport"):
                                newline = line.rsplit(" ", 1)
                                act_webif = True
        	camdinfo = ''
        	html = header_string
        	for info in infoList:
       		    addExternalChild(('%sstart' % info, CamdStart(info)))
        	    addExternalChild(('%skill' % info, CamdKill(info)))
        	    if info == self.actcam:
        	        if 'oscam' in self.actcam or 'doscam' in self.actcam or 'cccam' in self.actcam or 'CCcam' in self.actcam:
                            if act_webif == True:
                                camd = '%s<a href="%skill" target="_self">%s</a>' % (aktiv, info, deaktivieren)
                                #camd = '%s<a href="%skill" target="_self">%s</a></td><td align="right">%s_Webif<a href="http://%s:%s" target="_blank">%s</a>' % (aktiv, info, deaktivieren, self.actcam, ownip, newline[1], webaktivieren)
                                html += '<center><table style="width: 80%%;table-layout: fixed;" border="1" cellspacing="0"><tr><td align="center">%s_Webif<a href="http://%s:%s" target="_blank">%s</a></td></tr></center>' % (self.actcam, ownip, newline[1], webaktivieren)
                            else:
                                camd = '%s<a href="%skill" target="_self">%s</a>' % (aktiv, info, deaktivieren)
                        else:
                            camd = '%s<a href="%skill" target="_self">%s</a>' % (aktiv, info, deaktivieren)
        	    else:   
                	camd = '<a href="%sstart" target="_self">%s</a>%s</form>' % (info, aktivieren, deaktiviert)
        	    html += '<center><table style="width: 80%%;table-layout: fixed;" border="1" cellspacing="0"><tr><td align="left">%s:</td><td align="right">%s</td></tr></center>' % (info, camd)
        	    
                if os.path.isfile('/tmp/ecm.info'):
        	    fd = open('/tmp/ecm.info')
       		    for line in fd:
                	print line
                	html += '<center><table align="center" style="width: 50%%;" border="1" cellspacing="0"><tr><td>%s</font></td></tr></table></center>' % line
            
        	else:
        	    html += '<center><table style="width: 50%%;" border="1" cellspacing="0"><tr><td><font color="#a1a1a1">ECM Info N/A</font></td></tr></table></center>'
        	return html
Ejemplo n.º 45
0
    
	def render_GET(self, req):
        	req.setResponseCode(http.OK)
        	req.setHeader('Content-type', 'text/html')
        	req.setHeader('charset', 'UTF-8')
        	html = header_string
        	for info in infoList:
        	    if info == self.input:
                	cmd = "killall -15 " + self.input
                	self.Console.ePopen(cmd)
                	config.NFRSoftcam.actcam.value = ""
			config.NFRSoftcam.actcam.save()
			configfile.save()
                	html += '<center>%s erfolgreich beendet!  <a href="SoftcamControl" target="_self"><input type="submit" value="Zur&uuml;ck"></a></center>' % self.input
                	continue
        	    html += '<p></p>'
        	return html

    
	def finished(self, retval):
        	print 'finished', retval


addExternalChild(('SoftcamControl', SoftcamControl()))
infoList = checkCams(None)
ownip = createip(None) 
for info in infoList:
	addExternalChild(('%sstart' % info, CamdStart(info)))
	addExternalChild(('%skill' % info, CamdKill(info)))
Ejemplo n.º 46
0
from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
from Plugins.Extensions.EPGRefresh.EPGRefreshResource import \
		EPGRefreshStartRefreshResource, \
		EPGRefreshAddRemoveServiceResource, \
		EPGRefreshListServicesResource, \
		EPGRefreshChangeSettingsResource, \
		EPGRefreshSettingsResource, \
		EPGRefreshPreviewServicesResource, \
		API_VERSION

root = EPGRefreshListServicesResource()
root.putChild("refresh", EPGRefreshStartRefreshResource())
root.putChild("add", EPGRefreshAddRemoveServiceResource(EPGRefreshAddRemoveServiceResource.TYPE_ADD))
root.putChild("del", EPGRefreshAddRemoveServiceResource(EPGRefreshAddRemoveServiceResource.TYPE_DEL))
root.putChild("set", EPGRefreshChangeSettingsResource())
root.putChild("get", EPGRefreshSettingsResource())
root.putChild("preview", EPGRefreshPreviewServicesResource())
addExternalChild( ("epgrefresh", root, "EPGRefresh-Plugin", API_VERSION) )