从 Python PasteScript 自动生成 Python Egg
所以我正在使用 PasteScript 的粘贴器,并且我正在尝试自动化鸡蛋创建。我的第一步是获取 Python Egg 的模板。我注意到 PasteScript 的粘贴器有一个内置的,所以我一直从命令行创建我的模板:
$paster create -t basic_package
但是,这会以一系列提示的形式询问我问题(项目名称、作者、版本等)。调用 PasteScript 时是否可以使用配置文件或将参数直接传递到命令行?
我的目标是拥有一个可以运行的命令来生成鸡蛋模板。
感谢您的帮助!
So I'm using PasteScript's paster, and I'm trying to automate egg creation. My first step is to get a template of a Python egg. I noticed that PasteScript's paster has one built in, so I've been creating my template from the command line:
$paster create -t basic_package
However, this asks me the questions as a series of prompts (Project Name, Author, Version, etc). Is it possible to use a configuration file or a pass the argument directly into the command line when invoking PasteScript?
My goal is to have one command that I can run to generate an egg template.
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近自己发现了这一点。 “paster create”采用 --config 命令行参数。这可以是包含要使用的变量的文件。
例如:
我将根据名为 bobsetup.cfg 的配置创建一个名为 bob 的包。配置文件将包含:
然后我可以按如下方式使用它:
如果我检查 bob/setup.py 你可以看到它已经设置了变量。猫设置.py:
I recently discovered this myself. The "paster create" takes a --config command line argument. This can be a file which contains the variable to use.
For example:
I will create a package called bob from config called bobsetup.cfg. The configuration file will contain:
I can then use this as follows:
If I check the bob/setup.py you can see this has set up the variables. cat setup.py: