fixed some problems with admin no GAE, still readonly

This commit is contained in:
mdipierro
2012-08-29 15:09:08 -05:00
parent b5809db9eb
commit a40b55d8d4
6 changed files with 21 additions and 11 deletions
+4 -2
View File
@@ -14,6 +14,7 @@ FOR INTERNAL USE ONLY
import os
import thread
import logging
from fileutils import read_file
cfs = {} # for speed-up
@@ -34,15 +35,16 @@ def getcfs(key, filename, filter=None):
This is used on Google App Engine since pyc files cannot be saved.
"""
try:
logging.info(filename)
t = os.stat(filename).st_mtime
except OSError:
return filter()
return filter() if callable(filter) else ''
cfs_lock.acquire()
item = cfs.get(key, None)
cfs_lock.release()
if item and item[0] == t:
return item[1]
if not filter:
if not callable(filter):
data = read_file(filename)
else:
data = filter()