Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/raw-rev/7de42d758354
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 08:18:59 2012
Кодировка:

# HG changeset patch
# User Daniil Alexeyevsky
# Date 1311072022 -14400
# Node ID 7de42d7583547c542504b704a051918184d74af2
# Parent bbe1b872e4248531c6c9f4b2d81cb2d2de8661e8
Added deprecation warnings to the deprecated functions.

diff -r bbe1b872e424 -r 7de42d758354 allpy/base.py
--- a/allpy/base.py Mon Jul 18 19:53:06 2011 +0400
+++ b/allpy/base.py Tue Jul 19 14:40:22 2011 +0400
@@ -386,6 +386,9 @@

`whence` must be one of 'left', 'right' or 'center'
"""
+ deprecated(
+ "aln.flush('left') is deprecated in favor of aln.realign(Left())"
+ )
if whence == 'left':
from processors import Left as Flush
elif whence == 'right':
@@ -465,6 +468,11 @@
`function` (object) may have attributes `copy_descriptions` and
`copy_contents`, which override the same named arguments.
"""
+ deprecated(
+ "aln.process() is deprecated and may cause damage to your"
+ " alignment! It will be removed from 1.4.1 realease."
+ " Use aln.realign() instead."
+ )
new = function(self)
if hasattr(function, 'copy_descriptions'):
copy_descriptions = function.copy_descriptions
diff -r bbe1b872e424 -r 7de42d758354 allpy/util.py
--- a/allpy/util.py Mon Jul 18 19:53:06 2011 +0400
+++ b/allpy/util.py Tue Jul 19 14:40:22 2011 +0400
@@ -1,5 +1,6 @@
"""Miscellanous utilities.
"""
+import warnings

def unzip(seq):
"""The oppozite of zip() builtin."""
@@ -27,4 +28,8 @@
"""Clone of str that user may add attributes to."""
pass

+def deprecated(message):
+ """Warn about function being deprecated."""
+ warnings.warn(message, DeprecationWarning, stacklevel=2)
+
# vim: set et ts=4 sts=4 sw=4: