Hi,

Le jeudi 19 février 2009 à 08:19 +0100, Andreas Tille a écrit :

> >      * Detect the modules location dynamically from the script. You can
> >        see an example in the pychecker package.

Looking more closely, there is an even simpler way than that of
pychecker. Something like this should directly work:
        python -m Gnumed.wxpython.gnumed

> >      * Make /usr/bin/gnumed a python script, rewriting the environment
> >        manipulations in python; this makes the import trivial.
> 
> What means "trivial".  Is there an alternative example like pychecker
> for the first option?

I don’t have one handy, but the idea is to consider it a regular script.

Looking more closely at gnumed.py, it occurs to me that it is not even
meant to be in a modules directory:
        if __name__ != "__main__":
                print "GNUmed startup: This is not intended to be imported as a 
module 
        
This way, instead of a wrapper script, you could directly put this
script in /usr/bin, adding to it the necessary logic to read the
configuration.

> >      * Move part or all of the files to a private modules directory.
> 
> If you ask me this sounds like the most reasonable suggestion.  But
> how does it work together with python-support?  Any docs how the behaviour
> of python-support will change?  (I haven't followed the debian-python
> discussion very closely.)

This is very simple, just ship the modules to /usr/share/gnumed-client,
and modify your script to do something like:
        import sys
        sys.path.append("/usr/share/gnumed-client")
        import Gnumed.whatyouwant
        …

Python-support will handle this automatically; you just have to pass the
installation directory to the dh_pysupport call if it is non-standard.

Thanks for your quick answer,
-- 
 .''`.      Debian 5.0 "Lenny" has been released!
: :' :
`. `'   Last night, Darth Vader came down from planet Vulcan and told
  `-    me that if you don't install Lenny, he'd melt your brain.

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée

Reply via email to