[Checkins] SVN: z3c.testsetup/branches/ulif-deprecation-warnings/src/z3c/testsetup/util.py Add deprecation warner.

Uli Fouquet uli at gnufix.de
Thu Sep 24 04:41:01 EDT 2009


Log message for revision 104475:
  Add deprecation warner.
  

Changed:
  U   z3c.testsetup/branches/ulif-deprecation-warnings/src/z3c/testsetup/util.py

-=-
Modified: z3c.testsetup/branches/ulif-deprecation-warnings/src/z3c/testsetup/util.py
===================================================================
--- z3c.testsetup/branches/ulif-deprecation-warnings/src/z3c/testsetup/util.py	2009-09-24 08:23:44 UTC (rev 104474)
+++ z3c.testsetup/branches/ulif-deprecation-warnings/src/z3c/testsetup/util.py	2009-09-24 08:41:00 UTC (rev 104475)
@@ -13,6 +13,7 @@
 ##############################################################################
 """Helper functions for testsetup.
 """
+import os
 import sys
 import re
 from inspect import getmro, ismethod, getargspec
@@ -99,3 +100,9 @@
     obj = import_name(name)
     return getattr(obj, attr)
 
+def emit_deprecation_warning(text, package=None, filename=None):
+    filepath = ''
+    if package is not None and filename is not None:
+        dir = os.path.dirname(package.__file__)
+        filepath = 'file: %s\n' % os.path.join(dir, filename)
+    sys.stderr.write("z3c.testsetup: %s%s\n" % (filepath, text,))



More information about the checkins mailing list