fixed some problems with admin no GAE, still readonly
This commit is contained in:
+4
-2
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user