Esempio n. 1
0
    def __init__(self, session):
        resource.Resource.__init__(self)
        self.session = session

        try:
            from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerDoParseResource, \
             AutoTimerAddOrEditAutoTimerResource, AutoTimerChangeSettingsResource, \
             AutoTimerRemoveAutoTimerResource, AutoTimerSettingsResource, \
             AutoTimerSimulateResource
        except ImportError:
            # print "AT plugin not found"
            return
        self.putChild('parse', AutoTimerDoParseResource())
        self.putChild('remove', AutoTimerRemoveAutoTimerResource())
        self.putChild('edit', AutoTimerAddOrEditAutoTimerResource())
        self.putChild('get', AutoTimerSettingsResource())
        self.putChild('set', AutoTimerChangeSettingsResource())
        self.putChild('simulate', AutoTimerSimulateResource())
        try:
            from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerTestResource
            self.putChild('test', AutoTimerTestResource())
        except ImportError:
            # this is not an error
            pass
        self.putChild('uploadrestore', ATUploadFile(session))
        self.putChild('restore', AutoTimerDoRestoreResource())
        self.putChild('backup', AutoTimerDoBackupResource())
        self.putChild('tmp', static.File('/tmp'))  # nosec
Esempio n. 2
0
 def __init__(self, session, path=""):
     resource.Resource.__init__(self)
     self.session = session
     try:
         from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerDoParseResource, \
         AutoTimerAddOrEditAutoTimerResource, AutoTimerChangeSettingsResource, \
         AutoTimerRemoveAutoTimerResource, AutoTimerSettingsResource, \
         AutoTimerSimulateResource
     except ImportError:
         print "AT plugin not found"
         return
     self.putChild('parse', AutoTimerDoParseResource())
     self.putChild('remove', AutoTimerRemoveAutoTimerResource())
     self.putChild('edit', AutoTimerAddOrEditAutoTimerResource())
     self.putChild('get', AutoTimerSettingsResource())
     self.putChild('set', AutoTimerChangeSettingsResource())
     self.putChild('simulate', AutoTimerSimulateResource())
Esempio n. 3
0
    def __init__(self, session):
        resource.Resource.__init__(self)
        self.session = session

        try:
            from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerDoParseResource, \
             AutoTimerAddOrEditAutoTimerResource, AutoTimerChangeSettingsResource, \
             AutoTimerRemoveAutoTimerResource, AutoTimerSettingsResource, \
             AutoTimerSimulateResource
        except ImportError as e:
            # print "AT plugin not found"
            return
        self.putChild(b'parse', AutoTimerDoParseResource())
        self.putChild(b'remove', AutoTimerRemoveAutoTimerResource())
        self.putChild(b'edit', AutoTimerAddOrEditAutoTimerResource())
        self.putChild(b'get', AutoTimerSettingsResource())
        self.putChild(b'set', AutoTimerChangeSettingsResource())
        self.putChild(b'simulate', AutoTimerSimulateResource())
        try:
            from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerTestResource
            self.putChild(b'test', AutoTimerTestResource())
        except ImportError as e:
            # this is not an error
            pass
        try:
            from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerChangeResource
            self.putChild(b'change', AutoTimerChangeResource())
        except ImportError as e:
            # this is not an error
            pass
        self.putChild(b'uploadfile', ATUploadFile(session))
        self.putChild(b'restore', AutoTimerDoRestoreResource())
        self.putChild(b'backup', AutoTimerDoBackupResource())
        self.putChild(b'tmp', static.File(b'/tmp'))  # nosec
        try:
            from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerUploadXMLConfigurationAutoTimerResource, AutoTimerAddXMLAutoTimerResource
            self.putChild(b'upload_xmlconfiguration',
                          AutoTimerUploadXMLConfigurationAutoTimerResource())
            self.putChild(b'add_xmltimer', AutoTimerAddXMLAutoTimerResource())
        except ImportError as e:
            # this is not an error
            pass
from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
from Plugins.Extensions.AutoTimer.AutoTimerResource import AutoTimerDoParseResource, \
 AutoTimerListAutoTimerResource

root = AutoTimerListAutoTimerResource()
root.putChild('parse', AutoTimerDoParseResource())
addExternalChild(("autotimer", root))