Пример #1
0
    def __init__(self, session):
        resource.Resource.__init__(self)
        self.session = session

        try:
            from Plugins.Extensions.EPGRefresh.EPGRefreshResource import EPGRefreshSettingsResource, \
             EPGRefreshChangeSettingsResource, EPGRefreshAddRemoveServiceResource, \
             EPGRefreshStartRefreshResource
        except ImportError:
            # print("EPG Refresh Plugin not found")
            return
        self.putChild(b'get', EPGRefreshSettingsResource())
        self.putChild(b'set', EPGRefreshChangeSettingsResource())
        self.putChild(b'refresh', EPGRefreshStartRefreshResource())
        self.putChild(
            b'add',
            EPGRefreshAddRemoveServiceResource(
                EPGRefreshAddRemoveServiceResource.TYPE_ADD))
        self.putChild(
            b'del',
            EPGRefreshAddRemoveServiceResource(
                EPGRefreshAddRemoveServiceResource.TYPE_DEL))
        try:
            from Plugins.Extensions.EPGRefresh.EPGRefreshResource import EPGRefreshPreviewServicesResource
        except ImportError:
            pass
        else:
            self.putChild(b'preview', EPGRefreshPreviewServicesResource())
Пример #2
0
	def __init__(self, session, path = ""):
		resource.Resource.__init__(self)
		self.session = session
		try:
			from Plugins.Extensions.EPGRefresh.EPGRefreshResource import EPGRefreshSettingsResource, \
			EPGRefreshChangeSettingsResource, \
			EPGRefreshListServicesResource, EPGRefreshAddRemoveServiceResource, \
			EPGRefreshStartRefreshResource, API_VERSION
		except ImportError:
			print "ER plugin not found"
			return
		self.putChild('get', EPGRefreshSettingsResource())
		self.putChild('set', EPGRefreshChangeSettingsResource())
		self.putChild('refresh', EPGRefreshStartRefreshResource())
		self.putChild('add', EPGRefreshAddRemoveServiceResource(EPGRefreshAddRemoveServiceResource.TYPE_ADD))
		self.putChild('del', EPGRefreshAddRemoveServiceResource(EPGRefreshAddRemoveServiceResource.TYPE_DEL))
		try:
			from Plugins.Extensions.EPGRefresh.EPGRefreshResource import EPGRefreshPreviewServicesResource
		except ImportError:
			pass
		else:
			self.putChild('preview', EPGRefreshPreviewServicesResource())
Пример #3
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))