[Console] Fix showing file priorites

This commit is contained in:
Calum Lind 2017-02-22 15:32:40 +00:00
parent beb4f8c8f9
commit 52a85cb91c
1 changed files with 4 additions and 7 deletions

View File

@ -15,6 +15,7 @@ from unicodedata import normalize as ud_normalize
from unicodedata import east_asian_width from unicodedata import east_asian_width
import deluge.common import deluge.common
from deluge.ui.common import FILE_PRIORITY
def format_speed(speed): def format_speed(speed):
@ -68,15 +69,11 @@ def format_pieces(num, size):
def format_priority(prio): def format_priority(prio):
if prio == - 2: if prio == -2:
return '[Mixed]' return '[Mixed]'
if prio < 0: elif prio < 0:
return '-' return '-'
pstring = deluge.common.FILE_PRIORITY[prio] return FILE_PRIORITY[prio]
if prio > 0:
return pstring[:pstring.index('Priority') - 1]
else:
return pstring
def trim_string(string, w, have_dbls): def trim_string(string, w, have_dbls):