File tree Expand file tree Collapse file tree 5 files changed +5
-8
lines changed Expand file tree Collapse file tree 5 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ def create_app(config=None):
3030
3131 redis_store .init_app (app )
3232 cache .init_app (app )
33+ app .cache = cache
3334 app .plugin_modules = plugin_modules
3435
3536 slackbot = SlackBot (app )
Original file line number Diff line number Diff line change 66import cPickle as pickle
77from datetime import datetime
88
9- from flask import current_app
9+ from flask import current_app as app
1010import requests
1111
1212from utils import to_pinyin
@@ -195,7 +195,6 @@ def test(data):
195195
196196
197197def handle (data ):
198- app = current_app
199198 if app is None :
200199 ak = '18691b8e4206238f331ad2e1ca88357e'
201200 else :
Original file line number Diff line number Diff line change 33import hashlib
44from functools import partial
55
6- from flask import current_app
6+ from flask import current_app as app
77import requests
88
99from baidumap import address2geo
@@ -112,7 +112,6 @@ def test(data):
112112
113113
114114def handle (data ):
115- app = current_app
116115 message = data ['message' ]
117116 if app is None :
118117 appkey = '41502445'
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22# -*- coding: utf-8 -*-
3- from flask import current_app
3+ from flask import current_app as app
44import requests
55
66description = """
@@ -17,7 +17,6 @@ def test(data):
1717
1818
1919def handle (data ):
20- app = current_app
2120 org_name = app .config .get ('ORG_NAME' , 'python-cn' )
2221 repos = requests .get (REPO_API .format (org = org_name )).json ()
2322 rv = ''
Original file line number Diff line number Diff line change 11# coding=utf-8
22
3- from flask import current_app
3+ from flask import current_app as app
44import requests
55from bs4 import BeautifulSoup
66
@@ -62,7 +62,6 @@ def test(data):
6262
6363
6464def handle (data ):
65- app = current_app
6665 message = data ['message' ]
6766 if not isinstance (message , unicode ):
6867 message = message .decode ('utf-8' )
You can’t perform that action at this time.
0 commit comments