[wingide-users] Source Analysis issue with Plone Package files

Andrew D. Fields Andrew at Divix.biz
Tue Dec 11 09:51:49 MST 2007



--- Best Regards, 
Andrew D. Fields



> -----Original Message-----
> From: Wingware Support [mailto:support at wingware.com]
> Sent: Monday, December 10, 2007 5:32 PM
> To: Andrew D. Fields
> Cc: wingide-users at wingware.com
> Subject: Re: [wingide-users] Source Analysis issue with Plone Package
> files
> 
> Andrew D. Fields wrote:
> > I found a number of articles in the archive about "eggs" and
> > python/plone but none of them solved my issue.
> >
> > Here is the basic problem:
> >
> > Using "buildout" for Plone/Zope, you get a directory called "eggs"
> > that contains various **unzipped** egg copies (I realize WingIDE
> > doesn't support Zipped versions of eggs).
> ...
> 
> > Is this a known issue? I have to believe that as more and more
people
> > code Python using packages this will become more of an issue.  I
> could
> > of course "flatten" my "sfb" namespace into one dir, since I think
> > that would work, but that would clobber my existing "docs" dirs
> (since
> > each package gets one).
> 
> It sounds to me like buildout is using namespace magic similar to what
> Zope2 uses for its Products directory.  What is the point of import
> like?
> 
> from Eggs import archetypes.kss
> from Eggs import X  # Where X is something inside one of the eggs from
> archetypes import kss-1.2.3 from archetypes import kss
> 

I am not sure about this.  To me my understanding is that if I indicate
the "path" in my PYTHONPATH it should allow all classes to be imported.

I know that if I provide the *same* path to PYTHONPATH and open up a
python prompt, I can do the following:
>>> import sfb.theme.browser
>>> import sfb.cmis

However, in WingIDE if I type:
"import sfb." The only entries I get in the "drop down" are the items in
the *first* entry in my path. So, if the path has "sfb.theme" first, I
get all the sfb.theme entries, if it is sfb.cmis first, I get all the
sfb.cmis entries.  I don't think this is "magic" being done by Zope
because I get the correct result in the python prompt.


> Or something else?  I'm trying to understand if the point here is to
> merge the x.y.z name spaces or munge out the version numbers or both.

I think you need to *merge* the namespaces together; that is what I did
manually when I copied them all and "flattened" them.  The problem I
think is that there are *multiple* paths defined in the PYTHONPATH that
have the *same* namespace as the root.  For example:

PYTHONPATH=D:\eggs\sfb.theme\;D:\eggs\sfb.policy;D:\eggs\sfb.cmis;D:\egg
s\avc.theme;D:\eggs\avc.policy;

Note that "sfb" (the root) exists in 3 entries in that PYTHONPATH.  From
my experience, the Source Analysis will only scan/scrape entries in the
"D:\eggs\sfb.theme" folder; the other two folders get ignored.
Likewise, "avc.theme" will get scanned/scraped, and "avc.policy" will
get ignored.

> 
> We have code in Wing that simulates what Zope2 does so if it's the
same
> sort of name space merge then it wouldn't be hard to add a way to
> activate it in this case.
> 
> I may have some other ideas also, once I understand the use case
> better.
> 
> Note that I'm assuming you are using the right PYTHONPATH separator in
> your path (namely, ; on Windows and : on other OSes).

Yep, I have that right :)

> 
> Thanks,
> 
> --
> 
> Stephan Deibel
> Wingware | Python IDE
> Advancing Software Development
> 
> www.wingware.com




More information about the wingide-users mailing list