Exemplo n.º 1
0
def load_plugin_conf(name):
    try:
        plugin_conf = get_plugin_config_file(name)
        if not plugin_conf:
            return None

        return Parser().dict_from_file(plugin_conf)
    except ValueError as e:
        cherrypy.log.error_log.error(
            f'Failed to load plugin conf from {plugin_conf}: {e}')
Exemplo n.º 2
0
def load_plugin_conf(name):
    try:
        plugin_conf = get_plugin_config_file(name)
        if not plugin_conf:
            return None

        return Parser().dict_from_file(plugin_conf)
    except ValueError as e:
        cherrypy.log.error_log.error("Failed to load plugin "
                                     "conf from %s: %s" %
                                     (plugin_conf, e.message))
Exemplo n.º 3
0
def _load_plugin_conf(name):
    plugin_conf = PluginPaths(name).conf_file
    if not os.path.exists(plugin_conf):
        cherrypy.log.error_log.error("Plugin configuration file %s"
                                     " doesn't exist." % plugin_conf)
        return
    try:
        return Parser().dict_from_file(plugin_conf)
    except ValueError as e:
        cherrypy.log.error_log.error("Failed to load plugin "
                                     "conf from %s: %s" %
                                     (plugin_conf, e.message))
Exemplo n.º 4
0
def get_config():
    from cherrypy.lib.reprconf import Config, Parser
    root = get_root()
    config_filename = get_config_filename()
    cp = Parser()
    return Config(cp.dict_from_file(config_filename))
Exemplo n.º 5
0
import sys
import os
from cherrypy.lib.reprconf import Parser

# put this path into scope
_path = os.path.dirname(os.path.abspath(__file__))
_parent = os.path.dirname(_path)
if not _parent in sys.path:
    sys.path.append(_parent)

# load the config file
_conf = os.path.join(_path, 'config.conf')

# load the application's config file
config = Parser().dict_from_file(_conf)

from todo.views import *