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


Python codecs.BufferedIncrementalDecoder方法代碼示例

本文整理匯總了Python中codecs.BufferedIncrementalDecoder方法的典型用法代碼示例。如果您正苦於以下問題:Python codecs.BufferedIncrementalDecoder方法的具體用法?Python codecs.BufferedIncrementalDecoder怎麽用?Python codecs.BufferedIncrementalDecoder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在codecs的用法示例。


在下文中一共展示了codecs.BufferedIncrementalDecoder方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: reset

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:5,代碼來源:utf_32.py

示例2: __init__

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:5,代碼來源:utf_32.py

示例3: getstate

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def getstate(self):
        # additonal state info from the base class must be None here,
        # as it isn't passed along to the caller
        state = codecs.BufferedIncrementalDecoder.getstate(self)[0]
        # additional state info we pass to the caller:
        # 0: stream is in natural order for this platform
        # 1: stream is in unnatural order
        # 2: endianness hasn't been determined yet
        if self.decoder is None:
            return (state, 2)
        addstate = int((sys.byteorder == "big") !=
                       (self.decoder is codecs.utf_32_be_decode))
        return (state, addstate) 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:15,代碼來源:utf_32.py

示例4: setstate

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def setstate(self, state):
        # state[1] will be ignored by BufferedIncrementalDecoder.setstate()
        codecs.BufferedIncrementalDecoder.setstate(self, state)
        state = state[1]
        if state == 0:
            self.decoder = (codecs.utf_32_be_decode
                            if sys.byteorder == "big"
                            else codecs.utf_32_le_decode)
        elif state == 1:
            self.decoder = (codecs.utf_32_le_decode
                            if sys.byteorder == "big"
                            else codecs.utf_32_be_decode)
        else:
            self.decoder = None 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:16,代碼來源:utf_32.py

示例5: __init__

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.first = True 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:5,代碼來源:utf_8_sig.py

示例6: reset

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.first = True 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:5,代碼來源:utf_8_sig.py

示例7: getstate

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def getstate(self):
        # additional state info from the base class must be None here,
        # as it isn't passed along to the caller
        state = codecs.BufferedIncrementalDecoder.getstate(self)[0]
        # additional state info we pass to the caller:
        # 0: stream is in natural order for this platform
        # 1: stream is in unnatural order
        # 2: endianness hasn't been determined yet
        if self.decoder is None:
            return (state, 2)
        addstate = int((sys.byteorder == "big") !=
                       (self.decoder is codecs.utf_32_be_decode))
        return (state, addstate) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:15,代碼來源:utf_32.py

示例8: __init__

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.first = 1 
開發者ID:awemulya,項目名稱:kobo-predict,代碼行數:5,代碼來源:utf_8_sig.py

示例9: reset

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.first = 1 
開發者ID:awemulya,項目名稱:kobo-predict,代碼行數:5,代碼來源:utf_8_sig.py

示例10: getstate

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def getstate(self):
        state = codecs.BufferedIncrementalDecoder.getstate(self)
        # state[1] must be 0 here, as it isn't passed along to the caller
        return (state[0], self.first) 
開發者ID:awemulya,項目名稱:kobo-predict,代碼行數:6,代碼來源:utf_8_sig.py

示例11: setstate

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def setstate(self, state):
        # state[1] will be ignored by BufferedIncrementalDecoder.setstate()
        codecs.BufferedIncrementalDecoder.setstate(self, state)
        self.first = state[1] 
開發者ID:awemulya,項目名稱:kobo-predict,代碼行數:6,代碼來源:utf_8_sig.py

示例12: getstate

# 需要導入模塊: import codecs [as 別名]
# 或者: from codecs import BufferedIncrementalDecoder [as 別名]
def getstate(self):
        # additional state info from the base class must be None here,
        # as it isn't passed along to the caller
        state = codecs.BufferedIncrementalDecoder.getstate(self)[0]
        # additional state info we pass to the caller:
        # 0: stream is in natural order for this platform
        # 1: stream is in unnatural order
        # 2: endianness hasn't been determined yet
        if self.decoder is None:
            return (state, 2)
        addstate = int((sys.byteorder == "big") !=
                       (self.decoder is codecs.utf_16_be_decode))
        return (state, addstate) 
開發者ID:awemulya,項目名稱:kobo-predict,代碼行數:15,代碼來源:utf_16.py


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