Пример #1
0
def load_settings(settings_type=None):
    """ Creates a settings object from settings.cfg in the application root dir.
    This func has to be at the top of this module, since everything below here
    (basically) uses it. """

    config = SafeConfigParser()

    if settings_type == "private":
        filename = "settings_private.cfg"
    else:
        filename = "settings.cfg"

    config.readfp(open(filename))
    config.file_path = os.path.abspath(filename)
    return config