Skip to content
Snippets Groups Projects
Commit 5342a634 authored by Markus Willman's avatar Markus Willman
Browse files

fix truncateString

parent 1c2105a9
No related branches found
No related tags found
No related merge requests found
......@@ -27,8 +27,11 @@ def getCurrentTime(format = None):
return ts.strftime(format)
def truncateString(str, len):
return (str[:8] + '..') if len(str) > 10 else str
def truncateString(str, size):
if size <= 3:
return str
return (str[:(size-3)] + '...') if len(str) > size else str
class UnknownField(object):
def __init__(self, *_, **__): pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment