Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
Fixed tabulation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggirelli committed Feb 4, 2019
1 parent b4521e1 commit c5d5904
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions new_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

class EnableCors(object):
'''https://stackoverflow.com/a/17262900/1593536'''
name = 'enable_cors'
api = 2
def apply(self, fn, context):
def _enable_cors(*args, **kwargs):
# set CORS headers
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, OPTIONS'
response.headers['Access-Control-Allow-Headers'] = 'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token'
if request.method != 'OPTIONS':
# actual request; reply with the actual response
return fn(*args, **kwargs)
return _enable_cors
name = 'enable_cors'
api = 2
def apply(self, fn, context):
def _enable_cors(*args, **kwargs):
# set CORS headers
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, OPTIONS'
response.headers['Access-Control-Allow-Headers'] = 'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token'
if request.method != 'OPTIONS':
# actual request; reply with the actual response
return fn(*args, **kwargs)
return _enable_cors
pdApp.install(EnableCors())

@root.route("/browse")
Expand All @@ -46,19 +46,19 @@ def callback():

@root.route('/custom_images/<path>')
def callback(path):
return bot.static_file(path, f'{os.path.dirname(args.custom_routes)}/images/')
return bot.static_file(path, f'{os.path.dirname(args.custom_routes)}/images/')

@root.route('/custom_css/<path>')
def callback(path):
return bot.static_file(path, f'{os.path.dirname(args.custom_routes)}/css/')
return bot.static_file(path, f'{os.path.dirname(args.custom_routes)}/css/')

@root.route('/custom_js/<path>')
def callback(path):
return bot.static_file(path, f'{os.path.dirname(args.custom_routes)}/js/')
return bot.static_file(path, f'{os.path.dirname(args.custom_routes)}/js/')

@root.route('/custom_data/<path>')
def callback(path):
return bot.static_file(path, f'{os.path.dirname(args.custom_routes)}/data/')
return bot.static_file(path, f'{os.path.dirname(args.custom_routes)}/data/')

@root.route('/custom/giemsa_bands')
def callback():
Expand Down

0 comments on commit c5d5904

Please sign in to comment.