def get(self):
     pluginsDict = dict((key, request.args.get(key))
                        for key in request.args.keys())
     for plugin in pluginsDict:
         setPluginState(plugin, pluginsDict[plugin])
         if pluginsDict[plugin].lower() == u'true' and isPluginEnabled(
                 plugin, getApp()) == False:
             dirs = os.walk("plugins").next()
             if plugin not in dirs[1]:
                 raise PluginDoesNotExistException(plugin)
             else:
                 enablePlugin(getApi(), plugin)
Example #2
0
    getApi().add_resource(
        UserListResource,
        getPathWithPrefix('/user'))
    getApi().add_resource(
        MacrosTestsResource,
        getPathWithPrefix('/macros_tests'))
    getApi().add_resource(
        MetadataResource,
        getPathWithPrefix(
            '/service/<string:serviceName>/metadata/<string:metadata_id>'))
    getApi().add_resource(
        MetadataListResource,
        getPathWithPrefix(
            '/service/<string:serviceName>/metadata'))
    getApi().add_resource(AdminPluginListResource, getPathWithPrefix(
        '/admin/plugin'))
    getApi().add_resource(AdminPluginConfigResource, getPathWithPrefix(
        '/admin/plugin/config/<string:pluginName>'))
    getApi().add_resource(IconResource, getPathWithPrefix(
        '/service/<string:serviceName>/get_icon'))

    # end of the list of imported resources

    atexit.register(closeConnection)

    initApp(getApi())

if __name__ == '__main__':
    addResources()
    getApp().run(host="0.0.0.0", port=5001, debug=True)
Example #3
0
        getPathWithPrefix('/log'))
    getApi().add_resource(
        UserFindResource,
        getPathWithPrefix('/user/<string:user_id>'))
    getApi().add_resource(
        PluginConfigResource,
        getPathWithPrefix('/plugin_config/<string:pluginName>'))
    getApi().add_resource(
        UserListResource,
        getPathWithPrefix('/user'))
    getApi().add_resource(
        MacrosTestsResource,
        getPathWithPrefix('/macros_tests'))
    getApi().add_resource(
        MetadataResource,
        getPathWithPrefix(
            '/service/<string:serviceName>/metadata/<string:metadata_id>'))
    getApi().add_resource(
        MetadataListResource,
        getPathWithPrefix(
            '/service/<string:serviceName>/metadata'))
    # end of the list of imported resources

    atexit.register(closeConnection)

    initApp(getApi())

if __name__ == '__main__':
    addResources()
    getApp().run(host="0.0.0.0", port=5001, debug=True)