Author: dmeyer
Date: Sun Jan 29 11:32:25 2006
New Revision: 7887
Modified:
trunk/WIP/webserver/setup.py
Log:
only compile if needed
Modified: trunk/WIP/webserver/setup.py
==============================================================================
--- trunk/WIP/webserver/setup.py (original)
+++ trunk/WIP/webserver/setup.py Sun Jan 29 11:32:25 2006
@@ -30,6 +30,7 @@
# -----------------------------------------------------------------------------
import os
+import stat
import sys
import glob
import types
@@ -43,7 +44,7 @@
template_compiler = {
'kid': 'kidc -s',
- 'tmpl': 'cheetah -c'
+ 'tmpl': 'cheetah -c --nobackup'
}
def build_template(self, module, module_file, package):
@@ -55,6 +56,12 @@
ttype = os.path.splitext(module_file)[1][1:]
outfile = self.get_module_outfile(self.build_lib, package, module)
tmpfile = outfile[:-2] + ttype
+
+ if os.path.isfile(outfile) and \
+ os.stat(module_file)[stat.ST_MTIME] <
os.stat(outfile)[stat.ST_MTIME]:
+ # template up-to-date
+ return
+
self.copy_file(module_file, tmpfile, preserve_mode=0)
os.system('%s %s' % (self.template_compiler[ttype], tmpfile)) and
sys.exit(1)
os.unlink(tmpfile)
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog