Jolly
Jolly

Reputation: 314

Plugin not found in subcommand - Twisted (22.4.0)

My project structure is as below. I couldn't find enough data from the twisted documentation

-rolling
       ->roll
            ->__init__.py
            ->rollserver.py
       ->twisted
             ->plugins
                     ->roll_plugin.py

My roll_plugin.py looks like this-

from zope.interface import implementer
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from utils.annon_edro import Options, GPMSBridgeService
from roll..rollserver import RollFactory


@implementer(IServiceMaker, IPlugin)
class MyServiceMaker(object):
    tapname = "roll"
    description = 'Open the great door of roll for default'
    options = Options

    def makeService(self, options):
        return internet.TCPServer(8999, RollFactory())

serviceMaker = MyServiceMaker()

I ran twistd --help I do not see the sub command there. Whilst this code runs fine with Python2 but not with Python3.10.

  1. What am I doing wrong here?
  2. Is there any way we debug twistd code?

Upvotes: 1

Views: 176

Answers (1)

Jolly
Jolly

Reputation: 314

The directory path was missing in sys.path, adding it worked for me.

Upvotes: 1

Related Questions