automatic reload

A

Alan Baljeu

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/
 
M

Mike Driscoll

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 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,086
Latest member
ChelseaAmi

Latest Threads

Top