[pygtk] stricter versioning in scripts
04 Oct 2002 17:20:24 -0300
Em Sex, 2002-10-04 =E0s 17:00, David I. Lehn escreveu:
> I've had a slight problem with pygtk1 vs pygtk2 recently. The Debian
> packages are setup such that pygtk.pth defaults to pygtk1. Even when
> only pygtk2 is installed the maintainer still won't setup pygtk.pth to
> use pygtk2 . This breaks all pygtk2 scripts including all the
> examples. The only way to use pygtk2 scripts on Debian machines for now
> is to use the code:
> import pygtk; pygtk.require('2.0')
This is how it has to be, since debian ships both pygtk-0.6.x and
pygtk-1.99.x. Both modules are named gtk and creates a namespace
So, in debian they have choosed pygtk-0.6.x as the default. (old script
can still use import pygtk; pygtk.require ('1.2')).
This is sane, since all old scripts need to work.
Maybe in the future, perhaps for pygtk 2.2 we could add a warning if the
user tries to use the gtk module with pygtk imported. And in 2.4 or 3.0
make it required.
But i don't think it's nice to raise a warning at this stage, this code
has only existed for 1 stable/unstable release.
> Perhaps to solve such problems and future-proof scripts it might be a
> good idea to require that pygtk.require(...) is called in scripts from
> now on. If not specified the gobject/gtk import could annoy/warn the
> Good or bad idea?
>  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D163253
> pygtk mailing list firstname.lastname@example.org
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/