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

Karsten Hilbert Karsten.Hilbert at gmx.net
Thu Feb 19 19:41:33 UTC 2009


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

If that works that'd be a great way to start it !

> > 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.
I would remove the gnumed-debug virtual wrapper because that option
can these days be set from the authentication dialog.

> > 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
None of this is needed. It works just fine right now from
the site-packages/Gnumed/ directory. All that is needed to
"survive" the change to the system-wide modules directory
under Debian would be to make the /usr/bin/gnumed shell
script look for gnumed.py in that other directory (preferably
in a generic way like python -m ...).

No fiddling with sys.path, PYTHONPATH, gnumed.py or any other GNUmed
python file is needed. Let's not make this more complicated than it
really is.

What I don't approve of is the modify the .py files to look at certain
non-standard paths:

- adjusting sys.path is not encouraged in the Python community
  (similar to adjusting the default encoding)
- Python proper already got plenty of config options (systemwide
  and local site-package/, pth files, -m apparently) to make the
  actual location of modules flexible, there's no sane reason to
  invent another one in another layer

Karsten
-- 
Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL 
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a



More information about the Debian-med-packaging mailing list