over/core/aux.py
Martinez 660bae4bf0 add over.core.aux.DeprecationForwarder
add deprecation warning for over.core.textui
2015-06-08 16:34:44 +02:00

18 lines
449 B
Python

#! /bin/env python3
# encoding: utf-8
import sys
from . import text
_print = text.Output('over.core', stream=sys.stderr)
class DeprecationForwarder:
def __init__(self, target, old_name, new_name):
self.target = target
self.old_name = old_name
self.new_name = new_name
def __getattr__(self, name):
_print('%s is deprecated, please use %s instead' %(self.old_name, self.new_name), text.prefix.warn)
return getattr(self.target, name)