From e773ae69040caba55ffa397d3ebf3d60adf5b3cf Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Sun, 24 Jan 2010 21:01:43 +0200 Subject: [PATCH] convenience function to check is an string is empty --- src/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils.py b/src/utils.py index ae3a4ad..daffb06 100644 --- a/src/utils.py +++ b/src/utils.py @@ -8,6 +8,8 @@ def escape_html (text, max_length=40): text = text [0:cutpoint] + "..." return gobject.markup_escape_text (text) +def is_empty (text): + return not text or len (text.strip ()) == 0 # Set socket timeout import socket -- 1.7.9.5