From 320efc59bed699626aa3ae56638d8fa979469c24 Mon Sep 17 00:00:00 2001 From: James Troup Date: Tue, 3 Apr 2001 10:05:02 +0000 Subject: [PATCH] add fubar() and warn() --- utils.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/utils.py b/utils.py index 802187e0..1e6e871d 100644 --- a/utils.py +++ b/utils.py @@ -1,6 +1,6 @@ # Utility functions # Copyright (C) 2000 James Troup -# $Id: utils.py,v 1.19 2001-03-24 03:29:38 troup Exp $ +# $Id: utils.py,v 1.20 2001-04-03 10:05:02 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -363,9 +363,18 @@ def regex_safe (s): # Perform a substition of template def TemplateSubst(Map,Template): - for x in Map.keys(): - Template = string.replace(Template,x,Map[x]); - return Template; + for x in Map.keys(): + Template = string.replace(Template,x,Map[x]); + return Template; + +###################################################################################### + +def fubar(msg, exit_code=1): + sys.stderr.write("E: %s\n" % (msg)); + sys.exit(exit_code); + +def warn(msg): + sys.stderr.write("W: %s\n" % (msg)); ###################################################################################### -- 2.39.5