代码拉取完成,页面将自动刷新
同步操作将从 Time-Coder/Glass-Engine 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import subprocess
import os
import platform
import glob
import winreg
def get_python_paths(reg_key):
python_paths = {}
try:
i = 0
while True:
version = winreg.EnumKey(reg_key, i)
version_key = winreg.OpenKey(reg_key, version)
try:
install_key = winreg.OpenKey(version_key, "InstallPath")
except:
i += 1
continue
install_path, _ = winreg.QueryValueEx(install_key, None)
python_paths[version] = install_path.replace("\\", "/") + "python.exe"
i += 1
except OSError:
pass
return python_paths
def get_all_python_paths():
paths = {}
try:
reg_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Python\\PythonCore")
paths.update(get_python_paths(reg_key))
except:
pass
try:
reg_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\WOW6432Node\\Python\\PythonCore")
paths.update(get_python_paths(reg_key))
except:
pass
try:
reg_key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "SOFTWARE\\Python\\PythonCore")
paths.update(get_python_paths(reg_key))
except:
pass
return paths
with open("README_assimpy.rst", "r", encoding="utf-8") as in_file:
content = in_file.read()
with open("README.rst", "w", encoding="utf-8") as out_file:
out_file.write(content)
with open("setup_assimpy.py", "r", encoding="utf-8") as in_file:
content = in_file.read()
with open("setup.py", "w", encoding="utf-8") as out_file:
out_file.write(content)
with open("MANIFEST.in", "w") as out_file:
out_file.write(
"""include assimpy/LICENSE
include assimpy/README_PYPI.md
include assimpy/assimpy_ext.h
include assimpy/assimp-5.4.1.zip
include assimpy/pybind11-2.12.0.zip
include assimpy/__pyinstaller/assimp/LICENSE
include assimpy/__pyinstaller/pybind11/LICENSE
""")
python_paths = get_all_python_paths()
i = 0
for python_path in python_paths.values():
if i == 0:
subprocess.check_call([python_path, "setup.py", "sdist", "bdist_wheel"])
else:
subprocess.check_call([python_path, "setup.py", "bdist_wheel"])
if platform.system() == "Linux":
machine = platform.machine()
files = glob.glob(f"dist/assimpy-*-linux_{machine}.whl")
for file in files:
subprocess.call([python_path, "-m", "auditwheel", "repair", file, f"--plat=manylinux2014_{machine}", "-w", "dist"])
os.remove(file)
i += 1
with open("README_glass_engine.rst", "r", encoding="utf-8") as in_file:
content = in_file.read()
with open("README.rst", "w", encoding="utf-8") as out_file:
out_file.write(content)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。