py2app 说明
py2app 文档 提到了由 运行的说明__boot__.py
在主 python 脚本之前。我找不到一种方法可以轻松地在 setup.py 文件或构建过程中指定任何规定。
不过,我确实设法手动“破解”__boot__.py
,并在我的主_run(main_script)
之前添加另一个_run(prescript)
命令,它似乎工作正常。然而,使用标准 py2app 构建过程会更好。
我本质上想做的是在启动主脚本之前对我的sites-packages.zip 文件进行猴子修补。该规定本质上是检查服务器上的更新,如果有,则下载它们,然后覆盖 site-packages.zip 文件。比从头开始重新安装应用程序要快得多。
有什么想法吗?
The py2app documentation mentions prescripts, being run by __boot__.py
prior to the main python script. I couldn't find a way to easily specify any prescript on the setup.py file or build process.
I did however manage to 'hack' __boot__.py
manually and add another _run(prescript)
command before my main _run(main_script)
and it seemed to work fine. It would however be much better using the standard py2app build process.
What I'm essentially trying to do is monkey-patch my sites-packages.zip file prior to the main script being launched. The prescript essentially checks for updates on the server, and if there are any, downloads them, and then overwrites the site-packages.zip file. Much quicker than having to re-install the application from scratch.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅文档:您的
py2app.recipes
包必须包含一个配方,其check
方法返回一个dict
,其中包含'prescripts'
键,其值为,并且我引用,有关示例,请参阅内置食谱源。您需要在该软件包(安装在您的计算机上)中添加您自己的自定义配方。
See the docs: your
py2app.recipes
package must contain a recipe whosecheck
method returns adict
including the'prescripts'
key whose value is, and I quote,See the built-in recipes sources for examples. This package (as installed on your machine) is where you'll need to add your own custom recipes.