Python future.utils 模块,text_to_native_str() 实例源码

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

项目:hakkuframework    作者:4shadoww    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:hakkuframework    作者:4shadoww    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})
项目:packaging    作者:blockstack    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:packaging    作者:blockstack    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})
项目:islam-buddy    作者:hamir    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:islam-buddy    作者:hamir    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})
项目:procslink    作者:vfreex    | 项目源码 | 文件源码
def to_bytes(self):
        # TODO: This is a WORKAROUND!
        # Before Python 2.7.7, struct.pack() only accepts native str.
        # Uses of unicode will cause TypeError: Struct() argument 1 must be string, not unicode.
        # This have been fixed by the Python community:
        # https://hg.python.org/cpython/raw-file/f89216059edf/Misc/NEWS
        return struct.pack(text_to_native_str(self.FORMAT), self.nlmsg_len, self.nlmsg_type, self.nlmsg_flags,
                           self.nlmsg_seq, self.nlmsg_pid)
项目:procslink    作者:vfreex    | 项目源码 | 文件源码
def to_bytes(self):
        # TODO: This is a WORKAROUND!
        # Before Python 2.7.7, struct.pack() only accepts native str.
        # Uses of unicode will cause TypeError: Struct() argument 1 must be string, not unicode.
        # This have been fixed by the Python community:
        # https://hg.python.org/cpython/raw-file/f89216059edf/Misc/NEWS
        return struct.pack(text_to_native_str(self.FORMAT), self.version, self.flag, self.length,
                           self.payload_type, self.reserved, self.seq, self.timestamp)
项目:FightstickDisplay    作者:calexil    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:FightstickDisplay    作者:calexil    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})
项目:cryptogram    作者:xinmingzhang    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:cryptogram    作者:xinmingzhang    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})
项目:Repobot    作者:Desgard    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:Repobot    作者:Desgard    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})
项目:UMOG    作者:hsab    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:UMOG    作者:hsab    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})
项目:blackmamba    作者:zrzka    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:blackmamba    作者:zrzka    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})
项目:beepboop    作者:nicolehe    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:beepboop    作者:nicolehe    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})
项目:hackathon    作者:vertica    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:hackathon    作者:vertica    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})
项目:yatta_reader    作者:sound88    | 项目源码 | 文件源码
def _reconstruct_header(cls_name, bases, value):
    return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
项目:yatta_reader    作者:sound88    | 项目源码 | 文件源码
def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type(text_to_native_str('_'+cls.__name__), (cls, self.base_class), {})