def testGetPluginState(self):
     db = getDbObject()
     db[PLUGINS].save({NAME: TEST_NAME, ENABLED: True})
     obj = getPluginState(TEST_NAME)
     self.assertEqual(obj, True)
     obj = getPluginState('aaaaaaa')
     self.assertEqual(obj, False)
Exemple #2
0
def initApp(api):
    homeDir = os.getcwd()
    if homeDir.find('/var/www') != -1:
        homeDir = '/var/www/geomongo/'
        os.chdir(homeDir)
    else:
        if homeDir.find('src/tst') != -1:
            os.chdir('..')
    pluginList = getPluginList()
    for pluginName in pluginList:
        if getPluginState(pluginName) is True and \
                checkConfigPlugin(pluginName) is True:
            enablePlugin(api, pluginName)
    os.chdir(homeDir)
Exemple #3
0
def before_request():
    if isPluginUrl(request.url):
        pluginUrlList = request.url.split('/')
        pluginNameIndex = pluginUrlList.index('plugin') + 1
        if getPluginState(pluginUrlList[pluginNameIndex]) == False:
            raise PluginNotEnabledException