[PEAK] WorkingSet and sys.path

Leonardo Giordani leonardo.giordani at treuropa.com
Tue May 22 06:28:47 EDT 2007


Hi all,

I'm working on the following code (based on some code found on the 
documentation):

import pkg_resources as pr
ws = pr.WorkingSet()
d,e = ws.find_plugins(pr.Environment())
map(ws.add, d)
epmap = pr.get_entry_map(d[0])
getver = pr.load_entry_point(d[0], 'common', 'getVersionAndDependencies')

I expected ws.add to add each entry in d to my sys.path, but the latter 
remains unchanged, so executing load_entry_point fails because the module 
cannot be imported.

Probably I misunderstood how to use WorkingSet: anyone can help me?
My goal is to develop a plugin system for a Python application.

Thank you in advance

Leonardo Giordani


-- 
Leonardo Giordani

Tele-Rilevamento Europa - T.R.E. s.r.l.
a POLIMI spin-off company
Via Vittoria Colonna, 7
20149 Milano - Italia
tel.: +39.02.4343.121
fax: +39.02.4343.1230
e-mail: leonardo.giordani (at) treuropa.com
web: www.treuropa.com



More information about the PEAK mailing list