def render(self, req): req.setResponseCode(http.OK) req.setHeader('Content-type', 'application/xhtml+xml') req.setHeader('charset', 'UTF-8') try: from Plugins.SystemPlugins.vps import Vps except ImportError as ie: hasVps = False else: hasVps = True try: from Plugins.Extensions.SeriesPlugin.plugin import Plugins except ImportError as ie: hasSeriesPlugin = False else: hasSeriesPlugin = True defs = getAutoTimerSettingsDefinitions() resultstr = """<?xml version=\"1.0\" encoding=\"UTF-8\" ?><e2settings>""" for (title, cfg, key, description) in defs: resultstr += """<e2setting> <e2settingname>config.plugins.autotimer.%s</e2settingname> <e2settingvalue>%s</e2settingvalue> <e2settingtitle>%s</e2settingtitle> <e2settingdescription>%s</e2settingdescription> </e2setting>""" % (key, cfg.value, title, description) resultstr += """<e2setting> <e2settingname>hasVps</e2settingname> <e2settingvalue>%s</e2settingvalue> </e2setting> <e2setting> <e2settingname>hasSeriesPlugin</e2settingname> <e2settingvalue>%s</e2settingvalue> </e2setting> <e2setting> <e2settingname>version</e2settingname> <e2settingvalue>%s</e2settingvalue> </e2setting> <e2setting> <e2settingname>api_version</e2settingname> <e2settingvalue>%s</e2settingvalue> </e2setting> <e2setting> <e2settingname>autotimer_version</e2settingname> <e2settingvalue>%s</e2settingvalue> </e2setting> </e2settings>""" % (hasVps, hasSeriesPlugin, CURRENT_CONFIG_VERSION, API_VERSION, AUTOTIMER_VERSION) return resultstr
def render(self, req): req.setResponseCode(http.OK) req.setHeader('Content-type', 'application/xhtml+xml') req.setHeader('charset', 'UTF-8') try: from Plugins.SystemPlugins.vps import Vps except ImportError as ie: hasVps = False else: hasVps = True try: from Plugins.Extensions.SeriesPlugin.plugin import Plugins except ImportError as ie: hasSeriesPlugin = False else: hasSeriesPlugin = True defs = getAutoTimerSettingsDefinitions() resultstr = """<?xml version=\"1.0\" encoding=\"UTF-8\" ?><e2settings>""" for (title,cfg,key,description) in defs: resultstr += """<e2setting> <e2settingname>config.plugins.autotimer.%s</e2settingname> <e2settingvalue>%s</e2settingvalue> <e2settingtitle>%s</e2settingtitle> <e2settingdescription>%s</e2settingdescription> </e2setting>""" % (key, cfg.value , title , description ) resultstr += """<e2setting> <e2settingname>hasVps</e2settingname> <e2settingvalue>%s</e2settingvalue> </e2setting> <e2setting> <e2settingname>hasSeriesPlugin</e2settingname> <e2settingvalue>%s</e2settingvalue> </e2setting> <e2setting> <e2settingname>version</e2settingname> <e2settingvalue>%s</e2settingvalue> </e2setting> <e2setting> <e2settingname>api_version</e2settingname> <e2settingvalue>%s</e2settingvalue> </e2setting> <e2setting> <e2settingname>autotimer_version</e2settingname> <e2settingvalue>%s</e2settingvalue> </e2setting> </e2settings>""" % (hasVps, hasSeriesPlugin, CURRENT_CONFIG_VERSION, API_VERSION, AUTOTIMER_VERSION ) return resultstr