automatic reload

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alan Baljeu

    automatic reload

    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

    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/
  • Mike Driscoll

    #2
    Re: automatic reload

    On Nov 14, 11:04 am, Alan Baljeu <alanbal...@yah oo.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.collaborati ve-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

    Comment

    • alex23

      #3
      Re: automatic reload

      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:



      Comment

      Working...