Example #1
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()
Example #2
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"))
Example #3
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))
Example #4
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))
Example #5
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"
Example #6
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))
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!
Example #8
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")
	def render(self, request):
		request.setHeader('Access-Control-Allow-Origin', '*')
		return ScreenPage.render(self, request)
 def render(self, request):
     request.setHeader('Access-Control-Allow-Origin', '*')
     return ScreenPage.render(self, request)