當前位置: 首頁>>代碼示例>>Python>>正文


Python RequestHandler.__init__方法代碼示例

本文整理匯總了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)
開發者ID:Taipo,項目名稱:GlobaLeaks,代碼行數:34,代碼來源:base.py

示例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
開發者ID:corvolino,項目名稱:GlobaLeaks,代碼行數:12,代碼來源:base.py

示例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
開發者ID:jpobley,項目名稱:GlobaLeaks,代碼行數:15,代碼來源:base.py

示例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)
開發者ID:comradekingu,項目名稱:GlobaLeaks,代碼行數:22,代碼來源:base.py

示例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
開發者ID:INTERACT-IV,項目名稱:cyclone,代碼行數:6,代碼來源:sse.py


注:本文中的cyclone.web.RequestHandler.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。