[Twisted-Python] distutils and twisted

Steve Waterbury waterbug at beeblebrox.gsfc.nasa.gov
Wed Nov 6 08:21:47 MST 2002


Alexandre Fayolle wrote:

> What's the prefered way to use distutils to package a twisted plugin.
> The key question being, how do you install the plugins.tml file ? Is
> there any distutils extensions available ?

At last, a question I can answer!  (I'm a Twisted application 
developer, not a Twisted guru ... :^)  

Put your plugins.tml into the top dir of your application, e.g.:

myapp/__init__.py
     /plugins.tml    <---
     /myapptap.py
     /myappmodule1/...
     /myappmodule2/...

... and make sure that myapp is in your PYTHONPATH.  
Then if your plugins.tml looks something like this:

-------------------------------------------------
register("Myapp Tap Builder",
         "myapp.myapptap",
         description="""My Application""",
         type="tap",
         tapname="myapp")
-------------------------------------------------

... then mktap will create a myapp.tap file in the 
dir where you run it.  

For your setup.py, something like this should work 
(note data_files ... :^):

-------------------------------------------------
from distutils.core import setup

setup (name = "My Application",
       version = "0.0",
       description = "Blah blah",
       author = "Moi",
       author_email = "moi at world",
       maintainer = "admin",
       maintainer_email = 'admin at here',
       url = "http://spam.world/eggs",
       licence = "MIT",
       long_description = """\
My application does NOT suck!""",
       packages = ['myapp', 
                   'myapp.myappmodule1', 
                   'myapp.myappmodule2'
                   ],
       data_files = [('lib/python2.2/site-packages/myapp', ['myapp/plugins.tml'])
                   ]
      )
-------------------------------------------------

HTH,
-- Steve.




More information about the Twisted-Python mailing list