pretty basic (and also most likely final :-)) intergration with webif, open http...
[enigma2-plugins.git] / epgrefresh / src / EPGRefreshResource.py
1 from twisted.web2 import resource, responsecode, http
2 from EPGRefresh import epgrefresh
3
4 # pretty basic resource which is just present to have a way to start a
5 # forced refresh through the webif
6 class EPGRefreshResource(resource.Resource):
7         def __init__(self):
8                 resource.Resource.__init__(self)
9
10         def render(self, req):
11                 if req.args.has_key("refresh"):
12                         # XXX: we assume we already know the session
13                         epgrefresh.forceRefresh()
14                         output = "initiated refresh"
15                 else:
16                         output = "unknown command"
17                 return http.Response(responsecode.OK ,stream = output)
18