add functionalaty for deactivate truncation in mpd module
This commit is contained in:
parent
d0692798b7
commit
68813026e6
@ -101,13 +101,14 @@ class MPD(IntervalModule):
|
|||||||
else:
|
else:
|
||||||
fdict["filename"] = ""
|
fdict["filename"] = ""
|
||||||
|
|
||||||
for key in self.truncate_fields:
|
if self.max_field_len > 0:
|
||||||
if len(fdict[key]) > self.max_field_len:
|
for key in self.truncate_fields:
|
||||||
fdict[key] = fdict[key][:self.max_field_len - 1] + "…"
|
if len(fdict[key]) > self.max_field_len:
|
||||||
|
fdict[key] = fdict[key][:self.max_field_len - 1] + "…"
|
||||||
|
|
||||||
full_text = formatp(self.format, **fdict).strip()
|
full_text = formatp(self.format, **fdict).strip()
|
||||||
full_text_len = len(full_text)
|
full_text_len = len(full_text)
|
||||||
if full_text_len > self.max_len:
|
if full_text_len > self.max_len and self.max_len > 0:
|
||||||
shrink = floor((self.max_len - full_text_len)
|
shrink = floor((self.max_len - full_text_len)
|
||||||
/ len(self.truncate_fields)) - 1
|
/ len(self.truncate_fields)) - 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user