当前位置: 首页>>代码示例>>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;未经允许,请勿转载。