2011/6/20 selecta <gr...@delarue-berlin.de> > the open id error is gone now > (globals = None -> AttributeError: 'NoneType' object has no attribute > 'get') > 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. 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. How much do you need this extra feature? A+ ------------- Pierre My blog and profile (http://pierrethibault.posterous.com)<http://pierrethibault.posterous.com> YouTube page (http://www.youtube.com/user/tubetib)<http://www.youtube.com/user/tubetib> Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2>