Re: [web2py] Re: track_changes bug or feature?

2013-04-08 Thread Daniel Gonzalez Zaballos
Thanks! I said it because restarting the server with every little change in
a development environment, is a little weird. I'll change some imports to
make them inside methods.


2013/4/6 Massimo Di Pierro 

> This is intended. classone is importend once and it imports classtwo. This
> happens only once before http requests arrive. Python caches modules.
>
> track changes only affect import done explicitly at runtime (when http
> requests are processed).
>
> Changing this would require that web2py keep track of all dependencies
> (who import who). This would slow down everything.
>
> Massimo
>
>
> On Monday, 25 March 2013 09:55:19 UTC-5, demetrio wrote:
>>
>> Hi everyone,
>>
>> I have notice an strange behaviour of the track_changes feature (working
>> on web2py 2.3.2 and python 2.7.3).
>>
>> Imagine the following structure:
>>
>> modules/
>> ├── classone.py
>> ├── __init__.py
>> └── mymodule
>> ├── classtwo.py
>> └── __init__.py
>>
>> (assuming that there is a models/0.py file with the track_changes(True)
>> statement)
>>
>> In the file classone.py I have the following:
>> #=**=
>> #!/usr/bin/env python
>> # coding: utf8
>> from gluon import *
>> *from mymodule.classtwo import ClassTwo*
>>
>> class ClassOne(object):
>> def say_something(self):
>> classtwo = ClassTwo()
>> return classtwo.say_something()
>> #=**=
>>
>> And in classtwo.py this:
>> #=**=
>> #!/usr/bin/env python
>> # coding: utf8
>> from gluon import *
>>
>> class ClassTwo(object):
>> def say_something(self):
>> return "Hi!"
>> #=**=
>>
>> In this case, the changes inside ClassTwo are not tracked, but if I
>> change class one to:
>>
>> #=**=
>> #!/usr/bin/env python
>> # coding: utf8
>> from gluon import *
>>
>> class ClassOne(object):
>> def say_something(self):
>> *from mymodule.classtwo import ClassTwo*
>> classtwo = ClassTwo()
>> return classtwo.say_something()
>> #=**=
>>
>> Now it works correctly and all the changes are tracked, notice that now
>> the import statement is inside of a method.
>>
>> In the first case, the custom_importer() function is only called at the
>> first execution to import ClassTwo, but in the second case,
>> custom_importer its called in all executions.
>>
>> I have made an example application with this issue attached to this mail.
>>
>> Is this intended or it is a bug?
>>
>> greetings, Daniel.
>>
>>  --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: track_changes bug or feature?

2013-04-06 Thread Massimo Di Pierro
This is intended. classone is importend once and it imports classtwo. This 
happens only once before http requests arrive. Python caches modules.

track changes only affect import done explicitly at runtime (when http 
requests are processed).

Changing this would require that web2py keep track of all dependencies (who 
import who). This would slow down everything.

Massimo

On Monday, 25 March 2013 09:55:19 UTC-5, demetrio wrote:
>
> Hi everyone, 
>
> I have notice an strange behaviour of the track_changes feature (working 
> on web2py 2.3.2 and python 2.7.3). 
>
> Imagine the following structure: 
>
> modules/ 
> ├── classone.py 
> ├── __init__.py 
> └── mymodule 
> ├── classtwo.py 
> └── __init__.py 
>
> (assuming that there is a models/0.py file with the track_changes(True) 
> statement) 
>
> In the file classone.py I have the following: 
> #== 
> #!/usr/bin/env python 
> # coding: utf8 
> from gluon import * 
> *from mymodule.classtwo import ClassTwo* 
>
> class ClassOne(object): 
> def say_something(self): 
> classtwo = ClassTwo() 
> return classtwo.say_something() 
> #== 
>
> And in classtwo.py this: 
> #== 
> #!/usr/bin/env python 
> # coding: utf8 
> from gluon import * 
>
> class ClassTwo(object): 
> def say_something(self): 
> return "Hi!" 
> #== 
>
> In this case, the changes inside ClassTwo are not tracked, but if I 
> change class one to: 
>
> #== 
> #!/usr/bin/env python 
> # coding: utf8 
> from gluon import * 
>
> class ClassOne(object): 
> def say_something(self): 
> *from mymodule.classtwo import ClassTwo* 
> classtwo = ClassTwo() 
> return classtwo.say_something() 
> #== 
>
> Now it works correctly and all the changes are tracked, notice that now 
> the import statement is inside of a method. 
>
> In the first case, the custom_importer() function is only called at the 
> first execution to import ClassTwo, but in the second case, 
> custom_importer its called in all executions. 
>
> I have made an example application with this issue attached to this mail. 
>
> Is this intended or it is a bug? 
>
> greetings, Daniel. 
>
>

-- 

--- 
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/groups/opt_out.




[web2py] Re: track_changes bug or feature?

2013-04-02 Thread Massimo Di Pierro
will review this asap.

On Tuesday, 2 April 2013 04:53:57 UTC-5, demetrio wrote:
>
> A little bump on the topic.
>
> Somebody knows something about this?
>
> greetings, Daniel.
>
> El lunes, 25 de marzo de 2013 15:55:19 UTC+1, demetrio escribió:
>>
>> Hi everyone, 
>>
>> I have notice an strange behaviour of the track_changes feature (working 
>> on web2py 2.3.2 and python 2.7.3). 
>>
>> Imagine the following structure: 
>>
>> modules/ 
>> ├── classone.py 
>> ├── __init__.py 
>> └── mymodule 
>> ├── classtwo.py 
>> └── __init__.py 
>>
>> (assuming that there is a models/0.py file with the track_changes(True) 
>> statement) 
>>
>> In the file classone.py I have the following: 
>> #== 
>> #!/usr/bin/env python 
>> # coding: utf8 
>> from gluon import * 
>> *from mymodule.classtwo import ClassTwo* 
>>
>> class ClassOne(object): 
>> def say_something(self): 
>> classtwo = ClassTwo() 
>> return classtwo.say_something() 
>> #== 
>>
>> And in classtwo.py this: 
>> #== 
>> #!/usr/bin/env python 
>> # coding: utf8 
>> from gluon import * 
>>
>> class ClassTwo(object): 
>> def say_something(self): 
>> return "Hi!" 
>> #== 
>>
>> In this case, the changes inside ClassTwo are not tracked, but if I 
>> change class one to: 
>>
>> #== 
>> #!/usr/bin/env python 
>> # coding: utf8 
>> from gluon import * 
>>
>> class ClassOne(object): 
>> def say_something(self): 
>> *from mymodule.classtwo import ClassTwo* 
>> classtwo = ClassTwo() 
>> return classtwo.say_something() 
>> #== 
>>
>> Now it works correctly and all the changes are tracked, notice that now 
>> the import statement is inside of a method. 
>>
>> In the first case, the custom_importer() function is only called at the 
>> first execution to import ClassTwo, but in the second case, 
>> custom_importer its called in all executions. 
>>
>> I have made an example application with this issue attached to this mail. 
>>
>> Is this intended or it is a bug? 
>>
>> greetings, Daniel. 
>>
>>

-- 

--- 
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/groups/opt_out.




[web2py] Re: track_changes bug or feature?

2013-04-02 Thread demetrio
A little bump on the topic.

Somebody knows something about this?

greetings, Daniel.

El lunes, 25 de marzo de 2013 15:55:19 UTC+1, demetrio escribió:
>
> Hi everyone, 
>
> I have notice an strange behaviour of the track_changes feature (working 
> on web2py 2.3.2 and python 2.7.3). 
>
> Imagine the following structure: 
>
> modules/ 
> ├── classone.py 
> ├── __init__.py 
> └── mymodule 
> ├── classtwo.py 
> └── __init__.py 
>
> (assuming that there is a models/0.py file with the track_changes(True) 
> statement) 
>
> In the file classone.py I have the following: 
> #== 
> #!/usr/bin/env python 
> # coding: utf8 
> from gluon import * 
> *from mymodule.classtwo import ClassTwo* 
>
> class ClassOne(object): 
> def say_something(self): 
> classtwo = ClassTwo() 
> return classtwo.say_something() 
> #== 
>
> And in classtwo.py this: 
> #== 
> #!/usr/bin/env python 
> # coding: utf8 
> from gluon import * 
>
> class ClassTwo(object): 
> def say_something(self): 
> return "Hi!" 
> #== 
>
> In this case, the changes inside ClassTwo are not tracked, but if I 
> change class one to: 
>
> #== 
> #!/usr/bin/env python 
> # coding: utf8 
> from gluon import * 
>
> class ClassOne(object): 
> def say_something(self): 
> *from mymodule.classtwo import ClassTwo* 
> classtwo = ClassTwo() 
> return classtwo.say_something() 
> #== 
>
> Now it works correctly and all the changes are tracked, notice that now 
> the import statement is inside of a method. 
>
> In the first case, the custom_importer() function is only called at the 
> first execution to import ClassTwo, but in the second case, 
> custom_importer its called in all executions. 
>
> I have made an example application with this issue attached to this mail. 
>
> Is this intended or it is a bug? 
>
> greetings, Daniel. 
>
>

-- 

--- 
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/groups/opt_out.