At 05:09 PM 8/1/2005 -0500, Ian Bicking wrote:
>I was thinking some more about WSGI configuration, and much
>configuration involves some "import a string" routing, that looks like
>importstring("os.path:sep") or somesuch.  But we implement it slightly
>differently.  And maybe there could be a PEP and whatnot, but I don't
>even know what module that would go into, and it would just have to be
>backported for a long time anyway... but then it seemed like it would
>fit nicely into pkg_resources, and just about anywhere I want to import
>strings I expect pkg_resources to be around as well.

     from pkg_resources import EntryPoint

     def import_string(s):
         return EntryPoint.parse("x="+s).load(False)

_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to