Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

#!/usr/bin/env python 

from __future__ import absolute_import, division, print_function 

 

import gunicorn.app.base 

from gunicorn.six import iteritems 

 

from appr.api.app import create_app 

 

 

class GunicornApp(gunicorn.app.base.BaseApplication): 

def __init__(self, options=None): 

self.args_options = options or {} 

self.application = create_app() 

self.defaults = {} 

# {"worker_class": "gunicorn.workers.gthread.ThreadWorker"} 

 

super(GunicornApp, self).__init__(self.args_options) 

 

def load_config(self): 

config = dict([(key, value) for key, value in iteritems(vars(self.args_options)) 

if key in self.cfg.settings and value is not None]) 

for key, value in iteritems(self.defaults): 

config[key] = value 

for key, value in iteritems(config): 

self.cfg.set(key.lower(), value) 

 

def load(self): 

return self.application