-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

thanks a milion, alberto :)

alex

Alberto Valverde wrote:
> alex bodnaru wrote:
>> hi friends,
>>
>> how could a program know of all available widgets: like those not imported?
> 
> This should work
> 
> import pkg_resources
> from turbogears.widgets.base import Widget
> 
> widgets = []
> 
> for ep in pkg_resources.iter_entry_points("turbogears.widgets"):
>     module = ep.load(False)
>     print "loading widgets in %r" % module
>     widgets.extend([v for v in module.__dict__.values()
>                     if isinstance(v, Widget)])
> print "All installed widgets: %r" % widgets
> 
> Alberto
> 
> 
> 
> 
> > 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBR5I7fdpwN1sq38njAQKqQQP/WgZzG5UpAbjvW3HRmHX37cI9m+Qv7/Hj
2+I2dG3xcnc5N3CGyVcY5LTtxKfsSVnxO28w7fgI1NZPuRvDdlu/aRM5MzzuT7h4
r+MWH7Mu06yhZEUc41caPxoZR7RoNVtH7QbB+HWM7tURL6M3PJlHmN+J5M7I3C5T
76mXMjMVnyI=
=SZMi
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to