Update of /cvsroot/modeling/ProjectModeling/Modeling/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv22715/tests
Modified Files:
utils.py
Log Message:
added disable_model_cache/enable_model_cache_and_compute
Index: utils.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/utils.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** utils.py 7 May 2003 11:27:10 -0000 1.7
--- utils.py 24 Jul 2003 11:14:04 -0000 1.8
***************
*** 67,68 ****
--- 67,82 ----
% (len(result.errors), len(result.failures)))
return newerrs
+
+ def disable_model_cache():
+ import os
+ try:
+ del os.environ['MDL_ENABLE_SIMPLE_METHOD_CACHE']
+ except:
+ pass
+
+ def enable_model_cache_and_compute():
+ os.environ['MDL_ENABLE_SIMPLE_METHOD_CACHE']='yes'
+ from Modeling.ModelSet import defaultModelSet
+ for m in defaultModelSet().models(): # re-enable caching
+ m.cacheSimpleMethods()
+
|