Update of /cvsroot/webware/Webware/PSP
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9459
Modified Files:
PSPServletFactory.py
Log Message:
Making Webware CVS recompile PSP files if they change on disk, which is
how it works in Webware 0.8.1.
Index: PSPServletFactory.py
===================================================================
RCS file: /cvsroot/webware/Webware/PSP/PSPServletFactory.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** PSPServletFactory.py 29 Jul 2003 04:27:43 -0000 1.18
--- PSPServletFactory.py 26 Aug 2004 22:06:54 -0000 1.19
***************
*** 104,108 ****
classname = self.computeClassName(path)
classfile = os.path.join(self.cacheDir, classname + ".py")
! if not os.path.exists(classfile):
context = Context.PSPCLContext(path, transaction)
context.setClassName(classname)
--- 104,109 ----
classname = self.computeClassName(path)
classfile = os.path.join(self.cacheDir, classname + ".py")
! mtime = os.path.getmtime(path)
! if not os.path.exists(classfile) or os.path.getmtime(classfile) != mtime:
context = Context.PSPCLContext(path, transaction)
context.setClassName(classname)
***************
*** 110,113 ****
--- 111,117 ----
clc = PSPCompiler.Compiler(context)
clc.compile()
+ # Set the modification time of the compiled file to be the same as the source file;
+ # that's how we'll know if it needs to be recompiled
+ os.utime(classfile, (os.path.getatime(classfile), mtime))
theClass = self.loadClassFromFile(transaction, classfile, classname)
return theClass
|