En ny util-funksjon.
This commit is contained in:
parent
66d1ca3827
commit
f39cbbe957
|
@ -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):
|
||||
|
|
Reference in New Issue