def __init__(self, app, config): if 'sender' not in config: raise ConfigurationError("Postmark extension needs 'sender' configured") if 'api_key' not in config: raise ConfigurationError("Postmark extension needs 'api_key' configured") component = PostmarkComponent(config['sender'], config['api_key']) register_singleton(component, 'postmark')
def __init__(self, app, config): environment = Environment(loader=Loader(os.path.join(app.directory, 'templates'))) try: import markdown environment.filters['markdown'] = markdown.markdown except ImportError: pass component = JinjaComponent(environment) register_singleton(component, 'jinja')
def __init__(self, app, config): if 'sender' not in config: raise ConfigurationError( "Postmark extension needs 'sender' configured") if 'api_key' not in config: raise ConfigurationError( "Postmark extension needs 'api_key' configured") component = PostmarkComponent(config['sender'], config['api_key']) register_singleton(component, 'postmark')
def __init__(self, app, config): if 'host' not in config: raise ConfigurationError("Redis extension needs 'host' configured") if 'password' not in config: raise ConfigurationError("Postmark extension needs 'password' configured") host = config['host'] password = config['password'] redis = Redis(host=host, password=password) register_singleton(redis, 'redis')
def __init__(self, app, config): if 'host' not in config: raise ConfigurationError("Redis extension needs 'host' configured") if 'password' not in config: raise ConfigurationError( "Postmark extension needs 'password' configured") host = config['host'] password = config['password'] redis = Redis(host=host, password=password) register_singleton(redis, 'redis')