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
评论列表
文章目录