allow -R ...pyc, fixed issue 1186, thanks Corne.Dickens

This commit is contained in:
mdipierro
2012-11-29 18:21:06 -06:00
parent ef8f10c42d
commit 568c33d7d6
3 changed files with 11 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.2.1 (2012-11-29 17:12:52) stable
Version 2.2.1 (2012-11-29 18:20:27) stable
+3 -3
View File
@@ -1,10 +1,10 @@
EXPIRATION_MINUTES=60
DIGITS=('0','1','2','3','4','5','6','7','8','9')
import os, time, stat, cPickle, logging
path=os.path.join(request.folder,'sessions')
path = os.path.join(request.folder,'sessions')
if not os.path.exists(path):
os.mkdir(path)
now=time.time()
now = time.time()
for filename in os.listdir(path):
fullpath=os.path.join(path,filename)
if os.path.isfile(fullpath) and filename.startswith(DIGITS):
@@ -18,4 +18,4 @@ for filename in os.listdir(path):
if (now - filetime) > expiration:
os.unlink(fullpath)
except:
logging.exception('failure to check %s'%fullpath)
logging.exception('failure to check %s' % fullpath)
+7 -1
View File
@@ -220,7 +220,13 @@ def run(
_env.update(exec_pythonrc())
if startfile:
try:
execfile(startfile, _env)
ccode = None
if startfile.endswith('.pyc'):
ccode = read_pyc(startfile)
exec ccode in _env
else:
execfile(startfile, _env)
if import_models:
BaseAdapter.close_all_instances('commit')
except Exception, e: