On Tue, Dec 15, 2009 at 4:44 PM, Paul Querna <[email protected]> wrote:

>  > Second, you could have a simple reflection API, like:
> >
> > def drivers():
> >    """Returns a list of drivers (by name)"""
> >    return [
> >        os.path.splitext(name)[0]
> >        for name in os.listdir(os.path.join(os.path.dirname(__file__),
> > 'drivers')))
> >        if name.endswith('.py') and name != '__init__.py']
>
>
> Would this interface work on google app engine or similiar
> enviroments?  I ddin't think things like os.listdir etc would be
> expected to work?
>

It will work fine; you can read files on app engine, you just can't write
them.  Any environment that supports templates will support these kind of
operations, as templates are often shipped similar to this.

-- 
Ian Bicking  |  http://blog.ianbicking.org  |
http://topplabs.org/civichacker

Reply via email to