From: Chris A. <ca...@ca...> - 2000-11-23 04:55:32
|
I noticed one of the things on the wishlist is the ability to = automatically reload any classes that the current page is derived from. = Has any work been done on this? I took a quick look around for where = the current page is reloaded, and the only thing I turned up was = ServletFactory.import_servletForTransaction, but it doesn't seem to get = called anywhere. Any pointers as to where the code for reloading modules currently = resides? Or is it automatically done by Python? Cheers, Chris |
From: Mgr. V. K. <vk...@so...> - 2000-11-23 08:37:46
|
Chris AtLee wrote: > I noticed one of the things on the wishlist is the ability to = > automatically reload any classes that the current page is derived from. = This mean test time of change on all parents of page ? Performance will brings down ..... > Has any work been done on this? I took a quick look around for where = Only test with function reload from core Python. Not for Webware :-(. see attachmets > the current page is reloaded, and the only thing I turned up was = > ServletFactory.import_servletForTransaction, but it doesn't seem to get = > called anywhere. > > Any pointers as to where the code for reloading modules currently = > resides? see function reload from core Python. Imported modules are stored in dictionary sys.modules. > Or is it automatically done by Python? No, when module is once loaded, is not test for changes. vlk -- Mgr. Vladimir Kralik Softip a.s. Zvolenska cesta 19 974 01 Banska Bystrica tel. +421 88 4358 176 import random import sys sys.path.append('.') import ax class B(ax.A): pass for i in sys.modules.keys(): print "Module : ",i print "Class A instace a " a=ax.A() a.p() print "Class B instace b " b=B() b.p() print "Reload", "*"*50 f=open("ax.py","w") f.write(""" class A: def __init__(self): self.a=%d def p(self): print "AAAAAAAAA",self.a """ % random.randint(1,10000)) f.close() reload(ax) print "Class A instace a after reload " a.p() print "Class B instace b after reload " b.p() print "Class A instace c " c=ax.A() c.p() print "Class B instace d " d=B() d.p() print "Class X defined after reload" class X(ax.A): pass x=X() x.p() class A: def __init__(self): self.a=2043 def p(self): print "AAAAAAAAA",self.a |
From: <ca...@ca...> - 2000-11-23 22:20:08
|
Actually, I would really only want this available when developing software. OneShot.cgi is supposed to help with this, but my sessions keep expiring with OneShot.cgi, so I have to keep logging into my site. Chris On Thu, Nov 23, 2000 at 09:36:09AM +0100, Mgr. Vladimir Kralik wrote: > > Chris AtLee wrote: > > I noticed one of the things on the wishlist is the ability to = > > automatically reload any classes that the current page is derived from. > = > This mean test time of change on all parents of page ? Performance will > brings down ..... > > > Has any work been done on this? I took a quick look around for where = > Only test with function reload from core Python. Not for Webware :-(. > see attachmets > > > the current page is reloaded, and the only thing I turned up was = > > ServletFactory.import_servletForTransaction, but it doesn't seem to get = > > called anywhere. > > > > Any pointers as to where the code for reloading modules currently = > > resides? > see function reload from core Python. Imported modules are stored in > dictionary sys.modules. > > > Or is it automatically done by Python? > No, when module is once loaded, is not test for changes. > > vlk > > -- > Mgr. Vladimir Kralik > Softip a.s. > Zvolenska cesta 19 > 974 01 Banska Bystrica |
From: Chuck E. <ec...@mi...> - 2000-11-23 22:44:19
|
Did you change your WebKit/Application.config's 'SessionStore' to 'File'? Please let me know. If you did and your sessions continue to expire prematurely, then this is a bug. -Chuck At 05:19 PM 11/23/00 -0500, ca...@ca... wrote: >Actually, I would really only want this available when developing software. >OneShot.cgi is supposed to help with this, but my sessions keep expiring with >OneShot.cgi, so I have to keep logging into my site. > >Chris > >On Thu, Nov 23, 2000 at 09:36:09AM +0100, Mgr. Vladimir Kralik wrote: > > > > Chris AtLee wrote: > > > I noticed one of the things on the wishlist is the ability to = > > > automatically reload any classes that the current page is derived from. > > = > > This mean test time of change on all parents of page ? Performance will > > brings down ..... > > > > > Has any work been done on this? I took a quick look around for where = > > Only test with function reload from core Python. Not for Webware :-(. > > see attachmets > > > > > the current page is reloaded, and the only thing I turned up was = > > > ServletFactory.import_servletForTransaction, but it doesn't seem to get = > > > called anywhere. > > > > > > Any pointers as to where the code for reloading modules currently = > > > resides? > > see function reload from core Python. Imported modules are stored in > > dictionary sys.modules. > > > > > Or is it automatically done by Python? > > No, when module is once loaded, is not test for changes. > > > > vlk > > > > -- > > Mgr. Vladimir Kralik > > Softip a.s. > > Zvolenska cesta 19 > > 974 01 Banska Bystrica >_______________________________________________ >Webware-discuss mailing list >Web...@li... >http://lists.sourceforge.net/mailman/listinfo/webware-discuss |
From: Chris A. <ca...@ca...> - 2000-11-24 02:45:40
|
Ah, that would be it. That and the permissions on the Sessions directory weren't quite right :) Thanks, Chris ----- Original Message ----- From: "Chuck Esterbrook" <ec...@mi...> To: <web...@li...> Sent: Thursday, November 23, 2000 5:42 PM Subject: Re: [Webware-discuss] Reloading of updated modules > Did you change your WebKit/Application.config's 'SessionStore' to 'File'? > > Please let me know. If you did and your sessions continue to expire > prematurely, then this is a bug. > > -Chuck > > > At 05:19 PM 11/23/00 -0500, ca...@ca... wrote: > >Actually, I would really only want this available when developing software. > >OneShot.cgi is supposed to help with this, but my sessions keep expiring with > >OneShot.cgi, so I have to keep logging into my site. > > > >Chris > > > >On Thu, Nov 23, 2000 at 09:36:09AM +0100, Mgr. Vladimir Kralik wrote: > > > > > > Chris AtLee wrote: > > > > I noticed one of the things on the wishlist is the ability to = > > > > automatically reload any classes that the current page is derived from. > > > = > > > This mean test time of change on all parents of page ? Performance will > > > brings down ..... > > > > > > > Has any work been done on this? I took a quick look around for where = > > > Only test with function reload from core Python. Not for Webware :-(. > > > see attachmets > > > > > > > the current page is reloaded, and the only thing I turned up was = > > > > ServletFactory.import_servletForTransaction, but it doesn't seem to get = > > > > called anywhere. > > > > > > > > Any pointers as to where the code for reloading modules currently = > > > > resides? > > > see function reload from core Python. Imported modules are stored in > > > dictionary sys.modules. > > > > > > > Or is it automatically done by Python? > > > No, when module is once loaded, is not test for changes. > > > > > > vlk > > > > > > -- > > > Mgr. Vladimir Kralik > > > Softip a.s. > > > Zvolenska cesta 19 > > > 974 01 Banska Bystrica > >_______________________________________________ > >Webware-discuss mailing list > >Web...@li... > >http://lists.sourceforge.net/mailman/listinfo/webware-discuss > > _______________________________________________ > Webware-discuss mailing list > Web...@li... > http://lists.sourceforge.net/mailman/listinfo/webware-discuss |
From: Chuck E. <ec...@mi...> - 2000-11-24 03:23:57
|
Sounds like a good FAQ question. I'll add it to my small but budding scrap FAQ notes. -Chuck At 09:45 PM 11/23/00 -0500, Chris AtLee wrote: >Ah, that would be it. That and the permissions on the Sessions directory >weren't quite right :) > >Thanks, >Chris > >----- Original Message ----- >From: "Chuck Esterbrook" <ec...@mi...> >To: <web...@li...> >Sent: Thursday, November 23, 2000 5:42 PM >Subject: Re: [Webware-discuss] Reloading of updated modules > > > > Did you change your WebKit/Application.config's 'SessionStore' to 'File'? > > > > Please let me know. If you did and your sessions continue to expire > > prematurely, then this is a bug. > > > > -Chuck > > > > > > At 05:19 PM 11/23/00 -0500, ca...@ca... wrote: > > >Actually, I would really only want this available when developing >software. > > >OneShot.cgi is supposed to help with this, but my sessions keep expiring >with > > >OneShot.cgi, so I have to keep logging into my site. > > > > > >Chris > > > > > >On Thu, Nov 23, 2000 at 09:36:09AM +0100, Mgr. Vladimir Kralik wrote: > > > > > > > > Chris AtLee wrote: > > > > > I noticed one of the things on the wishlist is the ability to = > > > > > automatically reload any classes that the current page is derived >from. > > > > = > > > > This mean test time of change on all parents of page ? Performance >will > > > > brings down ..... > > > > > > > > > Has any work been done on this? I took a quick look around for >where = > > > > Only test with function reload from core Python. Not for Webware :-(. > > > > see attachmets > > > > > > > > > the current page is reloaded, and the only thing I turned up was = > > > > > ServletFactory.import_servletForTransaction, but it doesn't seem to >get = > > > > > called anywhere. > > > > > > > > > > Any pointers as to where the code for reloading modules currently = > > > > > resides? > > > > see function reload from core Python. Imported modules are stored in > > > > dictionary sys.modules. > > > > > > > > > Or is it automatically done by Python? > > > > No, when module is once loaded, is not test for changes. > > > > > > > > vlk > > > > > > > > -- > > > > Mgr. Vladimir Kralik > > > > Softip a.s. > > > > Zvolenska cesta 19 > > > > 974 01 Banska Bystrica > > >_______________________________________________ > > >Webware-discuss mailing list > > >Web...@li... > > >http://lists.sourceforge.net/mailman/listinfo/webware-discuss > > > > _______________________________________________ > > Webware-discuss mailing list > > Web...@li... > > http://lists.sourceforge.net/mailman/listinfo/webware-discuss > >_______________________________________________ >Webware-discuss mailing list >Web...@li... >http://lists.sourceforge.net/mailman/listinfo/webware-discuss |
From: Chuck E. <ec...@mi...> - 2000-11-24 03:00:04
|
I just double checked that the intended behavior currently works and it does. That is, if you change the servlet source, it gets reloaded. As you point out, that's not the case for ancestor servlets. I would like to see this feature at some point. I know some are concerned about performance, but [a] I don't think it would be a big impact and [b] it will be optional so it can be turned off. As far as who implements this, it's WebKit/ServletFactory.py, PythonServletFactory.servletForTransaction(): if os.path.getmtime(path)>self._cache[path].get('mtime', 0): (I'm looking at the latest CVS, but I think the latest release, 0.4.1, is the same.) Regarding implementing the ancestor behavior, this isn't on my near term list since using OneShot.cgi takes care of my development needs. I'm still interested to know if you have problems with OneShot and sessions when your Application.config is updated. See my previous message. Of course, if anyone wants to step in and provide the ancestor behavior, they're welcome to. -Chuck At 11:55 PM 11/22/00 -0500, Chris AtLee wrote: >I noticed one of the things on the wishlist is the ability to >automatically reload any classes that the current page is derived >from. Has any work been done on this? I took a quick look around for >where the current page is reloaded, and the only thing I turned up was >ServletFactory.import_servletForTransaction, but it doesn't seem to get >called anywhere. > >Any pointers as to where the code for reloading modules currently >resides? Or is it automatically done by Python? > >Cheers, >Chris |
From: Tripp L. <tl...@pe...> - 2000-11-24 05:57:47
|
On Thu, 23 Nov 2000, Chuck Esterbrook wrote: > As you point out, that's not the case for ancestor servlets. I would like > to see this feature at some point. I know some are concerned about > performance, but [a] I don't think it would be a big impact and [b] it will > be optional so it can be turned off. In addition to making autodetection optional, add a method one can call inside WebKit that will spawn a thread to check the freshness of all loaded classes, reloading as appropriate. Then one can build a page with a "freshen classes" button, so you still have the benefits of dynamic reloading without the overhead of constantly checking the sources for freshness. > Regarding implementing the ancestor behavior, this isn't on my near term > list since using OneShot.cgi takes care of my development needs. I'm still > interested to know if you have problems with OneShot and sessions when your > Application.config is updated. See my previous message. > > Of course, if anyone wants to step in and provide the ancestor behavior, > they're welcome to. If you want to assign the issue to me, I'll work on it when I have time, and if you (or anyone else) beats me to it, fine... -- Joy-Loving * Tripp Lilley * http://stargate.eheart.sg505.net/~tlilley/ ------------------------------------------------------------------------------ "There were other lonely singers / in a world turned deaf and blind Who were crucified for what they tried to show. Their voices have been scattered by the swirling winds of time, 'Cause the truth remains that no one wants to know." - Kris Kristofferson, "To Beat the Devil" |