本文整理匯總了Python中cyclone.web.RequestHandler.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python RequestHandler.__init__方法的具體用法?Python RequestHandler.__init__怎麽用?Python RequestHandler.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cyclone.web.RequestHandler
的用法示例。
在下文中一共展示了RequestHandler.__init__方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from cyclone.web import RequestHandler [as 別名]
# 或者: from cyclone.web.RequestHandler import __init__ [as 別名]
def __init__(self, application, request, **kwargs):
RequestHandler.__init__(self, application, request, **kwargs)
self.name = type(self).__name__
self.handler_time_analysis_begin()
self.handler_request_logging_begin()
self.req_id = GLSettings.requests_counter
GLSettings.requests_counter += 1
self.request.start_time = datetime_now()
self.request.request_type = None
if 'import' in self.request.arguments:
self.request.request_type = 'import'
elif 'export' in self.request.arguments:
self.request.request_type = 'export'
language = self.request.headers.get('GL-Language')
if language is None:
for l in self.parse_accept_language_header():
if l in GLSettings.memory_copy.languages_enabled:
language = l
break
if language is None or language not in GLSettings.memory_copy.languages_enabled:
language = GLSettings.memory_copy.default_language
self.request.language = language
self.set_header("Content-Language", language)
示例2: __init__
# 需要導入模塊: from cyclone.web import RequestHandler [as 別名]
# 或者: from cyclone.web.RequestHandler import __init__ [as 別名]
def __init__(self, application, request, **kwargs):
RequestHandler.__init__(self, application, request, **kwargs)
self.name = type(self).__name__
self.handler_time_analysis_begin()
self.handler_request_logging_begin()
self.req_id = GLSettings.requests_counter
GLSettings.requests_counter += 1
示例3: __init__
# 需要導入模塊: from cyclone.web import RequestHandler [as 別名]
# 或者: from cyclone.web.RequestHandler import __init__ [as 別名]
def __init__(self, application, request, **kwargs):
RequestHandler.__init__(self, application, request, **kwargs)
self.name = type(self).__name__
self.handler_time_analysis_begin()
self.handler_request_logging_begin()
self.req_id = GLSettings.requests_counter
GLSettings.requests_counter += 1
self.request.language = GLSettings.memory_copy.default_language
self.request.import_export = None
示例4: __init__
# 需要導入模塊: from cyclone.web import RequestHandler [as 別名]
# 或者: from cyclone.web.RequestHandler import __init__ [as 別名]
def __init__(self, application, request, **kwargs):
RequestHandler.__init__(self, application, request, **kwargs)
self.name = type(self).__name__
self.handler_time_analysis_begin()
self.handler_request_logging_begin()
self.req_id = GLSettings.requests_counter
GLSettings.requests_counter += 1
self.request.start_time = datetime_now()
self.request.request_type = None
if 'import' in self.request.arguments:
self.request.request_type = 'import'
elif 'export' in self.request.arguments:
self.request.request_type = 'export'
self.request.language = self.request.headers.get('GL-Language', GLSettings.memory_copy.default_language)
示例5: __init__
# 需要導入模塊: from cyclone.web import RequestHandler [as 別名]
# 或者: from cyclone.web.RequestHandler import __init__ [as 別名]
def __init__(self, application, request, **kwargs):
RequestHandler.__init__(self, application, request, **kwargs)
self.transport = request.connection.transport
self._auto_finish = False