I ended up fixing my own problem. I had declared some configuration variables directly within the config.py module.
I moved the functions that load the config information into a class and instantiate that class, and it all worked. On Thursday, April 10, 2014 1:02:05 AM UTC-5, Mark Graves wrote: > > Hey Everyone, > > For various reasons, I import some configuration information from files in > an application I'm working on (config.json). There are some limitations > which are forcing me to take this approach. > > This configuration information is imported in a web2py module file > (config.py) > > When I change the content of the flat file (verifiable by looking at the > contents), config.py does not seem to reload the values. It uses what was > previously stored in memory. Is this because the python interpreter has > already got a copy of config.py imported which contains pointers to the old > file? > > That is: > config.py is unchanged > config.json changes > importing config.py (which opens config.json) still seems to point to the > old version of the file. > > I am using: > > with open(file) as > > which I thought implicitly closed the file, and which I also thought would > reopen it(with changes) on the next import of that module. > > What's the best approach to tackle this? What am I missing? > > I'd appreciate any help or feedback. > > Thanks > > Mark > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.