예제 #1
0
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     self.set_header("Content-Type", "text/html; charset=utf-8")
     self.set_header("Access-Control-Allow-Origin", "*")
     self.set_header("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding")
     self.set_header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, HEAD")
     self.set_header("Vary", "Origin")
예제 #2
0
 def __init__(self, application, request):
     RequestHandler.__init__(self, application, request)
     self._current_user = None
     self.middleware_manager = MiddlewareManager(self)
     self._is_threaded = False
     self._is_whirlwind_finished = False
     self.view = {}
예제 #3
0
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     
     self._current_user_read = False
     self._current_user_write = False
     
     self.loader = tornado.template.Loader('frontend/')
예제 #4
0
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     _headers = self.request.headers
     self.ProductID = _headers.get(mn.MN_PRODUCT_ID, '')
     self.RequestID = _headers.get(mn.MN_REQUEST_ID, '')
     self._timeout = None
     self._instance = application._instance
예제 #5
0
파일: base.py 프로젝트: RiniJack/pyexercise
    def __init__(self, application, request, **kwargs):
        RequestHandler.__init__(self, application, request, **kwargs)

        self.userDb = UsersDB(self.application)
        self.postDb = PostsDB(self.application)

        self.set_header("Content-Type", "application/json")
예제 #6
0
    def __init__(self, application, request, **kwargs):

        self._prepare = []
        self._on_finish = []

        self._payload = kwargs

        RequestHandler.__init__(self, application, request)
예제 #7
0
파일: basehandler.py 프로젝트: hc990/let
 def __init__(self, application, request):
     RequestHandler.__init__(self, application, request)
     self._current_user = None
     self.middleware_manager = MiddlewareManager(self)
     self._is_threaded = False
     self._is_toolstar_finished = False
     self.view = dotdict()
     self.db = Mongo.db.ui  #@UndefinedVariable
예제 #8
0
	def __init__(self, application, request):
		RequestHandler.__init__(self, application, request)
		self._current_user = None
		self.middleware_manager = MiddlewareManager(self)
		self._is_threaded = False
		self._is_whirlwind_finished = False
		self.view = dotdict()
		self.db = Mongo.db.ui #@UndefinedVariable
예제 #9
0
파일: base.py 프로젝트: lovewinner/EMS
    def __init__(self, *args, **kwargs):
        RequestHandler.__init__(self, *args, **kwargs)
        UrlHandler.__init__(self)

        self.template_var = {}
        self.log_var = OrderedDict()

        self.errno = 0
예제 #10
0
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     _headers = self.request.headers
     self.mn_server = _headers.get(MN_INSTANCE_SERVER,'')
     self.mn_port = _headers.get(MN_INSTANCE_PORT,'')
     self.ProductID = _headers.get(MN_PRODUCT_ID,'')
     self._instance = application._instance
     self._search_count = 2
     self._not_found_callback = self._response_no_agent
예제 #11
0
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     _headers = self.request.headers
     self.mn_server = _headers.get(MN_INSTANCE_SERVER, '')
     self.mn_port = _headers.get(MN_INSTANCE_PORT, '')
     self.ProductID = _headers.get(MN_PRODUCT_ID, '')
     self._instance = application._instance
     self._search_count = 2
     self._not_found_callback = self._response_no_agent
예제 #12
0
파일: basehandler.py 프로젝트: ishida83/let
    def __init__(self, application, request):
        RequestHandler.__init__(self, application, request)
        self._current_user = None
#        self._username = None
#        self._keep_logged_in=False
        self.middleware_manager = MiddlewareManager(self)
        self._is_threaded = False
        self._is_toolstar_finished = False
        self._is_threaded = False
        self.view = dotdict()  
        self.db = Mongo.ui
예제 #13
0
파일: base.py 프로젝트: angeloce/saymyview
    def __init__(self, application, request, **kwargs):
        BaseRequestHandler.__init__(self, application, request, **kwargs)
        self.db = application.database

        if not self.template_env:
            self.template_env = Environment(loader=FileSystemLoader(convention.template_path))

        self.session = None
        session_id = self.get_cookie(self.SESSIONID)
        if session_id:
            self.session = Session.get_session(session_id)
예제 #14
0
    def __init__(self, application, request, **kwds):
        self.allowed_arugments: dict = {k.value: {}
                                        for k in RESTfulMethodType}  # allow any arguments
        self.required_arugments: dict = {
            k.value: [] for k in RESTfulMethodType}  # not require any arguments

        self.app_name = application.settings.get('name', None)

        ControllerAddon.__init__(self, application, request, **kwds)
        RequestHandler.__init__(self, application, request, **kwds)
        self.__cache: dict = None
예제 #15
0
파일: basehandler.py 프로젝트: hc990/let
 def __init__(self, application, request):
     RequestHandler.__init__(self, application, request)
     self._current_user = None
     #        self._username = None
     #        self._keep_logged_in=False
     self.middleware_manager = MiddlewareManager(self)
     self._is_threaded = False
     self._is_toolstar_finished = False
     self._is_threaded = False
     self.view = dotdict()
     self.db = Mongo.ui
예제 #16
0
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     self.account_dao = self.settings['account_dao']
     self.job_dao = self.settings['job_dao']
     self.config_dao = self.settings['config_dao']
     self.job_timer = self.settings['job_timer']
     self.account_info = None
     self.psd_question = None
     self.cookie_expires_days = 10
     self.end_notification = Exception('finish notification')
     self.push_server = self.settings['push_server']
     self.need_redirect_login = True
예제 #17
0
    def __init__(self, application, request, **kwargs):

        #TODO: This is really hacky, must be a more elegant wy to build up the path name
        thisModule = __import__(self.__module__)
        mods = self.__module__.split('.')
        thisAppName = mods[mods.index('Apps') + 1]
        template_path = 'Apps/%s/templates/' % (thisAppName)

        self.module_template_path = template_path
        self.application = application

        RequestHandler.__init__(self, application, request, **kwargs)
예제 #18
0
 def __init__(self, *args, **kwargs):
     """
     Instantiation of request handlers passes all ``*args`` and ``**kwargs``
     to :class:`.CoreBaseHandler` and :mod:`tornado` handler instantiation
     method.
     """
     try:
         self.rsc_id = kwargs.pop("_rsc_id")
     except KeyError:
         self.rsc_id = None
     CoreBaseHandler.__init__(self, *args, **kwargs)
     RequestHandler.__init__(self, *args, **kwargs)
예제 #19
0
    def __init__(self, application, request, **kwargs):

        #TODO: This is really hacky, must be a more elegant wy to build up the path name
        thisModule = __import__(self.__module__)
        mods = self.__module__.split('.')
        thisAppName = mods[mods.index('Apps') +1]
        template_path = 'Apps/%s/templates/' % (thisAppName)

        self.module_template_path = template_path
        self.application = application


        RequestHandler.__init__(self, application, request,**kwargs)
예제 #20
0
 def __init__(self, application, request, **kwargs):
     """
     Constructor.
     See `web.py <https://github.com/tornadoweb/tornado/blob/master/tornado/web.py>`_.
     """
     if 'ut_logged' in kwargs:
         # For unit test, we impose a logged user.
         self._logged_user = kwargs['ut_logged']['user']
         del kwargs['ut_logged']
     if 'dbman' in kwargs:
         self._db = kwargs['dbman']
         del kwargs['dbman']
     RequestHandler.__init__(self, application, request, **kwargs)
     self._app_log = logging.getLogger("tornado.application")
예제 #21
0
 def __init__(self, application, request, **kwargs):
     self.sqlalchemy_session = None
     self.login_user = None
     RequestHandler.__init__(self, application, request, **kwargs)
예제 #22
0
 def __init__(self, rpc_handler, *args, **kwargs):
     if not issubclass(rpc_handler, RpcHandler):
         raise Exception("Argument rpc_handler must be a subclass of " +
             "RpcHandler")
     self.rpc_handler = rpc_handler()
     RequestHandler.__init__(self, *args, **kwargs)
예제 #23
0
파일: web.py 프로젝트: tinyms/Matty
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
예제 #24
0
 def __init__(self, _application, request, **kwargs):
     RequestHandler.__init__(self, _application, request)
     self.accounts = kwargs['accounts']
예제 #25
0
 def __init__(self, output, *args):
     self.output = output
     RequestHandler.__init__(self, *args)
예제 #26
0
파일: web.py 프로젝트: angeloce/saymyview
 def __init__(self, *args, **kwargs):
     BaseRequestHandler.__init__(self, *args, **kwargs)
     if not self.template_env:
         self.template_env = Environment(loader = FileSystemLoader(self.application.settings['template_path']))
예제 #27
0
    def __init__(self, application, request, **kwargs):
        RequestHandler.__init__(self, application, request, **kwargs)
        self.set_header('Content-Type', 'text/json')

        if self.settings['allow_remote_access']:
            self.access_control_allow()
예제 #28
0
    def __init__(self, application, request, **kwargs):
        RequestHandler.__init__(self, application, request, **kwargs)
        self.set_header('Content-Type', 'text/json')

        if self.settings['allow_remote_access']:
            self.access_control_allow()
예제 #29
0
 def __init__(self, rpc_handler, *args, **kwargs):
     if not issubclass(rpc_handler, RpcHandler):
         raise Exception("Argument rpc_handler must be a subclass of " +
                         "RpcHandler")
     self.rpc_handler = rpc_handler()
     RequestHandler.__init__(self, *args, **kwargs)
예제 #30
0
 def __init__(self, master_ip):
     RequestHandler.__init__(self)
     self.master = master_ip
예제 #31
0
 def __init__(self, application, request, wrapper, fuzzer):
     RequestHandler.__init__(self, application, request)
     self.wrapper = wrapper
     self.fuzzer = fuzzer
예제 #32
0
 def __init__(self, application, request, **kwargs):
     if application.settings['db_user']:
         Document.set_db(application.couchdb)
     RequestHandler.__init__(self, application, request)
     self.output = kwargs.get('output','page')
     self.set_header("Content-Type", self.mime_type[self.output])
예제 #33
0
    def __init__(self, application, request, **kwargs):    
        self.logger = logging.getLogger(__name__)

        RequestHandler.__init__(self, application, request, **kwargs)
예제 #34
0
 def __init__(self, *args, **kwargs):
     UserMixin.__init__(self)
     RequestHandler.__init__(self, *args, **kwargs)
예제 #35
0
    def __init__(self, application, request, **kwargs):

        RequestHandler.__init__(self, application, request)

        self._payload = kwargs
예제 #36
0
파일: rest.py 프로젝트: extramental/neuron
    def __init__(self, *args, **kwargs):
        _RequestHandler.__init__(self, *args, **kwargs)

        self.environ = WSGIContainer.environ(self.request)
예제 #37
0
파일: __init__.py 프로젝트: launchar/abeja
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     self.context = Context(self)
예제 #38
0
 def __init__(self, *args, **kwargs):
     RequestHandler.__init__(self, *args, **kwargs)
예제 #39
0
 def __init__(self, application, request, **kwargs):
     self.path = None
     RequestHandler.__init__(self, application, request, **kwargs)
예제 #40
0
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     # TODO: REMOVE?
     self.access_control_allow()
예제 #41
0
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     self.set_header('Content-Type', 'text/json')
예제 #42
0
    def __init__(self, *args, **kwargs):
        RequestHandler.__init__(self, *args, **kwargs)

        self._session = None
예제 #43
0
 def __init__(self, application, request, **kwargs):
     self.controller = None
     self.domain = application.domain
     RequestHandler.__init__(self, application, request, **kwargs)
예제 #44
0
 def __init__(self, application, request, webpy_app):
     RequestHandler.__init__(self, application, request)
     self.webpy_app = webpy_app
예제 #45
0
 def __init__(self, *args, **kwargs):
     RequestHandler.__init__(self, *args, **kwargs)
     self.cfg = Config()
예제 #46
0
 def __init__(self, _application, request, **kwargs):
     RequestHandler.__init__(self, _application, request)
     self.accounts = kwargs['accounts']
예제 #47
0
파일: handler.py 프로젝트: chuanheng/xinrui
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     self.db = self.application.db
예제 #48
0
 def __init__(self, application, request, status_code):
     RequestHandler.__init__(self, application, request)
     self.set_status(status_code)
예제 #49
0
 def __init__(self, application, request, **kwargs):
     self.path = None
     RequestHandler.__init__(self, application, request, **kwargs)
예제 #50
0
파일: mino.py 프로젝트: yaimready/mino
def urlhandler_init_function(self,*args,**kwargs):
    RequestHandler.__init__(self,*args,**kwargs)
    for name,fn in self._proxyfuncs.items():
        setattr(self,name,partial(fn,self))
예제 #51
0
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     # init tmiddleware
     self.tmiddleware = TMiddleware(self)
예제 #52
0
 def __init__(self, application, request, status_code): 
     RequestHandler.__init__(self, application, request)
     self.set_status(status_code) 
예제 #53
0
    def __init__(self, *args, **kwargs):
        _RequestHandler.__init__(self, *args, **kwargs)

        self.environ = WSGIContainer.environ(self.request)
 def __init__(self, application, request, **kwargs):
     RequestHandler.__init__(self, application, request, **kwargs)
     self._sign = signature()
     self._deskew = imageDeskew()