mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
fix column trimming a bit
This commit is contained in:
parent
98a8be7131
commit
4d8b34209b
1 changed files with 7 additions and 3 deletions
|
@ -77,7 +77,11 @@ def format_priority(prio):
|
|||
return pstring
|
||||
|
||||
def trim_string(string, w, have_dbls):
|
||||
if have_dbls:
|
||||
if w <= 0:
|
||||
return ""
|
||||
elif w == 1:
|
||||
return "…"
|
||||
elif have_dbls:
|
||||
# have to do this the slow way
|
||||
chrs = []
|
||||
width = 4
|
||||
|
@ -92,9 +96,9 @@ def trim_string(string, w, have_dbls):
|
|||
if width != w:
|
||||
chrs.pop()
|
||||
chrs.append('.')
|
||||
return "%s... "%("".join(chrs))
|
||||
return "%s… "%("".join(chrs))
|
||||
else:
|
||||
return "%s... "%(string[0:w-4])
|
||||
return "%s… "%(string[0:w-2])
|
||||
|
||||
def format_column(col, lim):
|
||||
dbls = 0
|
||||
|
|
Loading…
Add table
Reference in a new issue