From f39cbbe957377e8cadced17a41fe3c3aa67a1abd Mon Sep 17 00:00:00 2001 From: oysteini Date: Sat, 8 Oct 2011 11:37:37 +0000 Subject: [PATCH] En ny util-funksjon. --- cli/util.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli/util.py b/cli/util.py index a4504e6..e207c46 100644 --- a/cli/util.py +++ b/cli/util.py @@ -53,6 +53,11 @@ def maptup(fun, lst): def translate(value, translations): return translations.get(value, value) +def str_or_empty(value): + if value: + return str(value) + return '' + def p(s): encoded = s if isinstance(s, unicode):