Esempio n. 1
0
def plugme(app_config, options):
    if 'default_language' not in options:
        options['default_language'] = 'EN'
    if 'async_sender' not in options:
        options.update({'async_sender': 'tgext.asyncjob'})
    app_config['_mailtemplates'] = options

    from mailtemplates import model
    milestones.config_ready.register(model.configure_models)

    if 'tgext.mailer' not in plugged(app_config):
        plug(app_config, 'tgext.mailer')

    if options['async_sender'] is None:
        pass
    elif options['async_sender'] == 'tgext.asyncjob':
        if 'tgext.asyncjob' not in plugged(app_config):
            plug(app_config, 'tgext.asyncjob')
    elif options['async_sender'] == 'tgext.celery':
        if 'tgext.celery' not in plugged(app_config):
            raise Exception(
                'please plug and CONFIGURE tgext.celery by yourself')
    else:
        raise Exception('async_sender unknown')

    return dict(appid='mailtemplates', global_helpers=False)
Esempio n. 2
0
def plugme(app_config, options):
    try:
        app_config['_pluggable_userprofile_config'] = options
    except TypeError:
        app_config.update_blueprint({'_pluggable_userprofile_config': options})

    milestones.config_ready.register(model.configure_models)

    if 'resetpassword' not in plugged(config=app_config):
        plug(app_config, 'resetpassword')

    if 'tgext.mailer' not in plugged(config=app_config):
        plug(app_config, 'tgext.mailer')

    return dict(appid='userprofile', global_helpers=False)
Esempio n. 3
0
 def _detect_loaded_pluggables(self):
     app = loadapp('config:%s' % self.options.ini, relative_to=os.getcwd())
     return plugged()
 def _detect_loaded_pluggables(self):
     app = loadapp('config:%s' % self.options.ini, relative_to=os.getcwd())
     return plugged()
Esempio n. 5
0
 def _detect_loaded_pluggables(self, opts):
     app = loadapp('config:%s' % opts.config, relative_to=os.getcwd())
     return plugged()
Esempio n. 6
0
 def _detect_loaded_pluggables(self, opts):
     app = loadapp('config:%s' % opts.config, relative_to=os.getcwd())
     return plugged()