From: Ivan Frade Date: Sun, 24 Jan 2010 19:01:43 +0000 (+0200) Subject: convenience function to check is an string is empty X-Git-Tag: mussorgsky-0.4-1~8 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=e773ae69040caba55ffa397d3ebf3d60adf5b3cf;hp=8f9a85474f01752f8781bab658c80b0925949415;p=mussorgsky convenience function to check is an string is empty --- 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