> > but the pygments error still exists
> > oldmod = sys.modules['pygments.lexers']
> > KeyError: 'pygments.lexers'
> > any clue about this one?
> > --
>
> Hello,
>
> The importer will import the module as something like
> applications.appname.modules.pygments (this the name used for sys.modules)
> if the module to import is in the directory "modules". This enables to have
> different versions of the same module for different applications.
>
> Since pygments is accessing a module with sys.modules, you cannot use
> pygments in the "modules" directory. You can put pygments in site-packages
> instead. Or you can modify pygments for working with web2py (more difficult
> I guess).
>
> This is feature. It is not a bug.
oh :P
>
> I guess I can improve the design by replacing sys.modules by a class that
> will do the lockup in applications.appname if it fails like in this example.
> How can I access appname from the code? I guess this is the new thread
> variable thing implemented recently.
not sure i can follow you here, do you mean request.application?? no i
guess i'm lost
>
> How much do you need this extra feature?
well, what i want to do is to create an application that i can
distribute easily (pyMantis, ...) for this i need to be able to add
new modules in future distributions and remove them again if they are
not needed, so far I have written a plugin for creating releases (win
linux mac and web2py app packages) and updating running releases
(using the web2py app packages). The plugin currently looks into the
site packages folder and adds all site packages from a local myapp/
site-packages directory. This i not so nice i think and also a bit
error-prone. So it would be nice to create web2py app packages that
just work without any further setup steps (just like web2pys
philosophy: batteries included)