funcs.py 文件源码

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

项目:petronia 作者: groboclown 项目源码 文件源码
def __load_functions(modules):
    import platform
    import struct

    # Ensure we're on Windows
    assert 'windows' in platform.system().lower()
    void_ptr_bits = struct.calcsize('P') * 8
    winver = sys.getwindowsversion()
    environ = {
        '32-bit': void_ptr_bits == 32,
        '64-bit': void_ptr_bits == 64,
        'release': platform.release(),
        'version': platform.version(),
        'system': platform.system(),
        'version-major': winver.major,
        'version-minor': winver.minor,
        'version-build': winver.build,
        'version-platform': winver.platform,
        'version-service_pack': winver.service_pack,
    }

    ret = {}
    for name in modules:
        if isinstance(name, str):
            try:
                mod = importlib.import_module(name, __name__)
            except:
                print("Problem loading module " + name)
                raise
        else:
            mod = name
        mod.load_functions(environ, ret)
    return ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号