1 from twisted.web2 import resource, responsecode, http
2 from AutoTimer import AutoTimer
5 # pretty basic resource which is just present to have a way to start a
6 # forced run through the webif
7 class AutoTimerResource(resource.Resource):
9 resource.Resource.__init__(self)
11 def render(self, req):
12 from plugin import autotimer
15 autotimer = AutoTimer()
18 if req.args.has_key("parse"):
19 ret = autotimer.parseEPG()
20 output = _("Found a total of %d matching Events.\n%d Timer were added and %d modified.") % (ret[0], ret[1], ret[2])
22 output = "unknown command"
26 return http.Response(responsecode.OK ,stream = output)