views:

20

answers:

1

I'm trying to write a Gnome applet in Python. In fact, I've written the app and I'm stuck when it comes to packaging it.

I started by looking into distutils. The problem I ran into right away was that when specifying py_modules, an extension of .py is expected. However, Gnome applets are basically shell scripts. (That use the Python interpreter, of course.)

Here is what I tried... but it isn't working.

from distutils.core import setup

setup(name='myapp',
    version='1.2',
    py_modules=['myapp'],
)

Also, the myapp file has to get put in /usr/lib/myapp/. As far as I know, distutils puts the files in with the other modules.

How should I go about doing this?

A: 

Scripts should be installed with the script option to distutils.core.setup() as described in distutils documentation. On the other hand, py_modules is used to list individual modules, and they must have .py extension as you described.

Also, if you want to add additional files, the data_files option lets you specify both source and destination of the files.

Answer summary: Read whole distutils documentation.

nosklo