[Modeling-cvs] ProjectModeling/Modeling __init__.py,1.2,1.3 utils.py,1.16,1.17
Status: Abandoned
Brought to you by:
sbigaret
From: <sbi...@pr...> - 2004-01-28 14:55:21
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6412/Modeling Modified Files: __init__.py utils.py Log Message: Env. variable MDL_PERMANENT_DB_CONNECTION is now deprecated and has no effect anymore. It has been replaced by MDL_TRANSIENT_DB_CONNECTION which has the inverse semantics --see the User's Guide, appendix Environment Variables, for details. Index: __init__.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/__init__.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** __init__.py 10 Jan 2003 10:45:44 -0000 1.2 --- __init__.py 28 Jan 2004 14:54:09 -0000 1.3 *************** *** 25,45 **** import DatabaseContext # make it register itself for notifications ! ! # from AccessControl import ModuleSecurityInfo ! ! ! ! ! # ModuleSecurityInfo('Modeling').declarePublic('utils') ! ! # m = ModuleSecurityInfo('Modeling.utils') ! # m.declarePublic('lower') ! ! ! ! ! ! ! ! --- 25,29 ---- import DatabaseContext # make it register itself for notifications ! from utils import migration_warnings ! migration_warnings() Index: utils.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/utils.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** utils.py 4 Oct 2003 12:29:43 -0000 1.16 --- utils.py 28 Jan 2004 14:54:09 -0000 1.17 *************** *** 231,232 **** --- 231,244 ---- methods=[m for m in methods if m.__name__ not in exclude] return methods + + def migration_warnings(): + """ + This method is responsible for warning the user when we detect that he/she + is relying on a feature (e.g. an environment variable) that has been + deprecated/removed and as no effect anymore (or will have no effect anymore + in a near future). + """ + import os,warnings + if os.environ.has_key('MDL_PERMANENT_DB_CONNECTION'): + msg="Environment variable MDL_PERMANENT_DB_CONNECTION is deprecated since 0.9pre17 and it has no effect anymore. The framework's default behaviour is now to leave the database connection opened. This variable has been replaced by the variable MDL_TRANSIENT_DB_CONNECTION which has the inverse semantics. Please refer to the User's Guide, appendix Environment Variables, for further details" + warnings.warn(msg, DeprecationWarning) |