nodes.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:PYKE 作者: muddyfish 项目源码 文件源码
def load_node(node, file_path):
    path_var = "node.%s"%node
    main_module = imp.load_source(path_var, file_path)
    for c in main_module.__dict__.values():
        try:
            if issubclass(c, Node) and c.__module__ is main_module.__name__:
                nodes[node] = c
                if c.char and isinstance(c.char, str):
                    c.char = bytearray([ord(c.char[-1].encode()) | (0x80 * (len(c.char) == 2))])
                elif isinstance(c.char, bytes):
                    c.char = bytearray(c.char)
                    c.ignore_dot = True
                elif c.char == "":
                    c.char = b""
                return c
        except TypeError:
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号