Пример #1
0
def load_config(config=None):
    log.info('loading config...')
    if config is None:
        from samuraix.defaultconfig import config

    if callable(config):
        config = config()
    samuraix.config = config
Пример #2
0
def load_config(config=None):
    """
        Sets :attr:`samuraix.config` to the desired configuration dictionary.
        If *config* is None, it will load :mod:`samuraix.defaultconfig`.
        If *config* is callable, it will call it and use the return value
        instead.
    """
    if config is None:
        from samuraix.defaultconfig import config
    if callable(config):
        config = config()
    import samuraix
    samuraix.config = config