By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,941 Members | 1,789 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,941 IT Pros & Developers. It's quick & easy.

automatic reload

P: n/a
I need a solution for automatically reloading files I edited. This is in a unit testing/fixing context, so there shouldn't be much problem with leftover data. I just need to be able to call a reload_changed() method of some sort before rerunning tests. Stopping and restarting the python interpreter (it's embedded) might be an option if (a) that's feasible within a process and (b) it's quick.

Alan Baljeu
http://www.collaborative-systems.org
Intelligent software that works _with_ you.

__________________________________________________ ________________
Get a sneak peak at messages with a handy reading pane with All new Yahoo! Mail: http://ca.promos.yahoo.com/newmail/overview2/
Nov 14 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Nov 14, 11:04*am, Alan Baljeu <alanbal...@yahoo.comwrote:
I need a solution for automatically reloading files I edited. *This is in a unit testing/fixing context, so there shouldn't be much problem with leftover data. *I just need to be able to call a reload_changed() method of some sort before rerunning tests. *Stopping and restarting the python interpreter (it's embedded) might be an option if (a) that's feasible withina process and (b) it's quick.

*Alan Baljeuhttp://www.collaborative-systems.org
Intelligent software that works _with_ you.
There's the "reload" builtin that you could use. In your method, just
call reload on the modules you need reloaded. TurboGears somehow
watches files for changes, so you might want to check out their source
to see how it works. I'm sure it's something similar.

Mike
Nov 14 '08 #2

P: n/a
Mike Driscoll <kyoso...@gmail.comwrote:
TurboGears somehow
watches files for changes, so you might want to check out their source
to see how it works. I'm sure it's something similar.
I think that's more an inherited feature from TG's use of CherryPy.
There's some code provided on the CP site that might be useful:

http://www.cherrypy.org/wiki/AutoReload

Nov 15 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.