在* .tac文件中使用usage.options扭曲 [英] twistd using usage.options in a *.tac file

查看:69
本文介绍了在* .tac文件中使用usage.options扭曲的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Twisted编写服务器,该服务器基于启动服务和应用程序的* .tac文件.我想获得一个额外的命令行参数来指定yaml配置文件.我尝试通过建立一个继承自它的类来使用use.Options,但由于在我的类Options(...)类中未指定其他扭曲的命令行参数(例如-y)而感到窒息.

I'm writing a server with Twisted that is based on a *.tac file that starts the services and the application. I'd like to get one additional command line argument to specify a yaml configuration file. I've tried using usage.Options by building a class that inherits from it, but is choking because of the additional, twistd command line arguments (-y for example) not being specified in my class Options(...) class.

如何获得另一个论点,而仍然将其余论点传递给扭曲论者?我必须使用插件系统来做到这一点吗?

How can get one additional argument and still pass the rest to twistd? Do I have to do this using the plugin system?

提前感谢您的帮助!

道格

推荐答案

tac文件配置.它不接受配置.

A tac file is configuration. It doesn't accept configuration.

如果要传递命令行参数,则确实需要编写一个插件.

If you want to pass command line arguments, you do need to write a plugin.

这篇关于在* .tac文件中使用usage.options扭曲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆