Python codecs 模块,BufferedIncrementalDecoder() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用codecs.BufferedIncrementalDecoder()

项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
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)
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
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
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.first = 1
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
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)
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def setstate(self, state):
        # state[1] will be ignored by BufferedIncrementalDecoder.setstate()
        codecs.BufferedIncrementalDecoder.setstate(self, state)
        self.first = state[1]
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
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)
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
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)
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
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
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.first = True
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.first = True
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.first = True
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
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)
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
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)
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
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
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.first = True
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.first = True
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.first = True
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
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)
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.first = True
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.first = True
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
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)
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
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
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:ivaochdoc    作者:ivaoch    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None
项目:ivaochdoc    作者:ivaoch    | 项目源码 | 文件源码
def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None
项目:ivaochdoc    作者:ivaoch    | 项目源码 | 文件源码
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)
项目:ivaochdoc    作者:ivaoch    | 项目源码 | 文件源码
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
项目:ivaochdoc    作者:ivaoch    | 项目源码 | 文件源码
def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.first = 1