예제 #1
0
 def retry_load_city_info(self):
     task = AsyncTask(self.info_loader)
     task.start()
예제 #2
0
 def load_city_info(self, city):
     self.info_loader.city = city
     task = AsyncTask(self.info_loader)
     task.start()
예제 #3
0
 def load_countries(self):
     task = AsyncTask(self.db_loader)
     task.start()
예제 #4
0
 def load_cities(self, country_id):
     self.db_loader.country_id = country_id
     task = AsyncTask(self.db_loader)
     task.start()
예제 #5
0
from flask import Flask
from flask import request, jsonify, make_response
from bot_exception import BotException
from slackclient import SlackClient
from config import Config
from bot import Bot
from async_task import AsyncTask
import requests
import json

config = Config()
slack_client = SlackClient(config.bot_token)
bot = Bot()

app = Flask(__name__)
async_task = AsyncTask()


@app.errorhandler(BotException)
def handle_bot_exception(error):
    response = jsonify(error.to_dict())
    response.status_code = error.status_code
    return response


#
# Message Event Listener
# Entry point for all events from slack
#
@app.route('/quotebot', methods=['POST', 'GET'])
def event_listener():