mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 16:38:43 +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
|
return pstring
|
||||||
|
|
||||||
def trim_string(string, w, have_dbls):
|
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
|
# have to do this the slow way
|
||||||
chrs = []
|
chrs = []
|
||||||
width = 4
|
width = 4
|
||||||
|
@ -92,9 +96,9 @@ def trim_string(string, w, have_dbls):
|
||||||
if width != w:
|
if width != w:
|
||||||
chrs.pop()
|
chrs.pop()
|
||||||
chrs.append('.')
|
chrs.append('.')
|
||||||
return "%s... "%("".join(chrs))
|
return "%s… "%("".join(chrs))
|
||||||
else:
|
else:
|
||||||
return "%s... "%(string[0:w-4])
|
return "%s… "%(string[0:w-2])
|
||||||
|
|
||||||
def format_column(col, lim):
|
def format_column(col, lim):
|
||||||
dbls = 0
|
dbls = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue