From 957f73ed8c2c22afd5e56adc36b4d032b3f1a5f1 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 7 Apr 2022 18:34:41 +0200 Subject: vyos.base: T4346: add common DeprecationWarning() class --- python/vyos/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/vyos/base.py b/python/vyos/base.py index c78045548..fd22eaccd 100644 --- a/python/vyos/base.py +++ b/python/vyos/base.py @@ -15,6 +15,12 @@ from textwrap import fill +class DeprecationWarning(): + def __init__(self, message): + # Reformat the message and trim it to 72 characters in length + message = fill(message, width=72) + print(f'\nDEPRECATION WARNING: {message}\n') + class ConfigError(Exception): def __init__(self, message): # Reformat the message and trim it to 72 characters in length -- cgit v1.2.3