On Monday, 11 February 2013 03:20:47 UTC+11, Massimo Di Pierro wrote:
>
> No. Track changes only tracks changes for modules that are stored in the 
> application.
>

While looking for something else, I came across this in the online version 
of the book, in the core chapter; I've emphasised in bold something which 
may not be correct since it seems to contradict Massimo's comment in this 
thread.


For uniformity with normal Python behavior, by default web2py does not 
reload modules when changes are made. Yet this can be changed. To turn on 
the auto-reload feature for modules, use the track_changes function as 
follows (typically in a model file, before any imports):

from gluon.custom_import import track_changes; track_changes(True)

>From now on, every time a module is imported, the importer will check if 
the Python source file (.py) has changed. If it has changed, the module 
will be reloaded. *This applies to all Python modules, even Python modules 
outside web2py.*





 

>
> On Sunday, 10 February 2013 05:48:41 UTC-6, Tim Richardson wrote:
>>
>> I have 2.3.2 with python 2.7 on Windows.
>>
>> I'm importing a module from an odd location in the file system, and 
>> therefore doing
>> from gluon.custom_import import track_changes; track_changes(True) #while 
>> in development
>>
>> sys.path.append('C:\...')   # a windows path
>> import mod1    #a module in the directory
>>
>>
>> It imports but the application does not pick up changes until I stop & 
>> restart the rocket server.  It appears to me that track_changes(True) is 
>> not working. I wonder if it is due to sys.path.append
>>
>>
>>
>>
>>
>>
>>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to