[Debian-med-packaging] Bug#516037: Bug#516037: gnumed-client: hard-codes the location to python module

Andreas Tille tillea at rki.de
Thu Feb 19 08:43:27 UTC 2009


On Thu, 19 Feb 2009, Josselin Mouette wrote:

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

I'll think about this.

> 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

Actually yes, this is true.  It was just amongst the other python files
and I wanted to write a wrapper script for different configurations
inside Debian anyway.  So I left it where it was and thought it might
not harm to have it compiled into byte code.

> 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.

As I said - it can be started (ar at least there were times when we
started it with differend wrappers which used different configurations).
The reasons for doing so might have become void these days - I'll
keep on thinking about this.

> 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.

Ahh, that sounds good!

> Thanks for your quick answer,

Same to you. ;-)

Kind regards

       Andreas.

-- 
http://fam-tille.de


More information about the Debian-med-packaging mailing list