durusmail: qp: (no subject)
(no subject)
2007-07-21
2007-07-21
Re: (no subject)
2007-07-21
2007-07-22
(no subject)
Ernesto Adorio
2007-07-21
>
>
> >
> > > It looks like you must somehow be getting
> >     '/home/toto/qp_sites'
> > > instead of
> >     '/home/toto/qp_sites/extreme'
> > . from a call to
> >     Site('extreme').get_package_directory()
> > >Is that correct?
> >
> > What do you get from the following?
> >    import qp.sites.extreme
> >    print qp.sites.extreme.__path__
> >
> > I get both.
> >  >>> import qp.sites.extreme
> > >>> print qp.sites.extreme.__path__
> > ['/home/toto/qp_sites', '/home/toto/qp_sites/extreme']
>
> Okay, we are getting closer.
> When I do this with my sites, the __path__ list only has one
> value, and it is the correct one.
>
> Does your /home/toto/qp_sites/extreme/__init__.py
> or your  /home/toto/qp_sites/__init__.py
> contain anything that might modify the __path__ list?
>
> I guess you are right about this.  The contents of this file follows:

from os.path import expanduser, expandvars, isdir
sites_path = ["${QP_SITES}", "~/qp_sites", "~/.qp_sites", '/var/qp_sites']
sites_path += __path__

__path__ = []
for raw_path in sites_path:
    path = expanduser(expandvars(raw_path))
    if isdir(path):
        __path__.append(path)

I feel quilty but I can't recall where I got or when I modified this
__init__.py file since I normally don't touch the qp-qpy system files. I
copied the __init__.py of the latest demo/proto/__init__.py which simply
contains

from qpy.compile import compile_qpy_files
compile_qpy_files(__path__[0])

and there are no more errors. As an aside the qp.sites.__path now is

['/home/toto/qp_sites', '/usr/local/lib/python2.4/site-packages/qp/sites']

There are still two values, but anyway the problem has already disappeared.



Thanks to David and to Mike too. I thought the qp  mailing system was
already inactive. :)

Regards,

Ernie
reply