2
这里是我twistd
插件,它位于project_root/twisted/plugins/my_plugin.py
的当前状态:为什么我在没有选项的情况下运行`twistd`命令时不会显示我的扭曲插件?
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from zope.interface import implements
from twisted.plugin import IPlugin
from twisted.python.usage import Options
from twisted.application import internet, service
from mylib.io import MyFactory
class Options(Options):
"""Flags and options for the plugin."""
optParameters = [
('sock', 's', '/tmp/io.sock', 'Path to IO socket'),
]
class MyServiceMaker(object):
implements(service.IServiceMaker, IPlugin)
tapname = "myplugin"
description = "description for my plugin"
options = Options
def makeService(self, options):
return internet.UNIXServer(options['sock'], MyFactory())
- 有没有
__init__.py
文件中project_root/twisted/plugins/
- 的
twistd
输出不显示我的插件时,从项目的根目录运行 - 我通过
python setup.py develop --user
安装了我的库,它可以从任何地方导入
任何想法?
我有同样的问题......但我没有忘记你做过的事情。 – rschwieb 2017-07-07 19:02:26