Ejemplo n.º 1
0
    def run(self, execution_context):
        from app import APP_INSTANCE as app
        app.reload_config()

        url = app.get_config('bot.url')
        msg = {'name': 'reload', 'args': {}}
        execution_context.finish('reload done')
        http.call(url, msg)
Ejemplo n.º 2
0
 def run(self, execution_context):
     pattern = r'^[\w_]+$'
     bot_name = execution_context.event.get('bot')
     if bot_name is None or bot_name is '':
         raise ValueError('bot name cannot be null or empty')
     if not re.match(pattern, bot_name):
         raise ValueError('bot name can only contains alphanumeric characters and underscore')
     from app import APP_INSTANCE as app
     app.reload_config(bot_name)
     execution_context.finish('switched to ' + bot_name)
Ejemplo n.º 3
0
 def run(self, execution_context, _):
     """run the action"""
     from app import APP_INSTANCE as app
     app.reload_config()
     execution_context.finish()
Ejemplo n.º 4
0
 def run(self, execution_context):
     from app import APP_INSTANCE as app
     app.reload_config()
     execution_context.finish()