mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
Fix #1484: trying to access the screen object when not using interactive mode
This commit is contained in:
parent
82fbbad385
commit
4d2a0b1856
1 changed files with 5 additions and 4 deletions
|
@ -189,10 +189,11 @@ class Command(BaseCommand):
|
|||
s += " %s" % (fp)
|
||||
# Check if this is too long for the screen and reduce the path
|
||||
# if necessary
|
||||
cols = self.console.screen.cols
|
||||
slen = colors.get_line_length(s, self.console.screen.encoding)
|
||||
if slen > cols:
|
||||
s = s.replace(f["path"], f["path"][slen - cols + 1:])
|
||||
if hasattr(self.console, "screen"):
|
||||
cols = self.console.screen.cols
|
||||
slen = colors.get_line_length(s, self.console.screen.encoding)
|
||||
if slen > cols:
|
||||
s = s.replace(f["path"], f["path"][slen - cols + 1:])
|
||||
self.console.write(s)
|
||||
|
||||
self.console.write(" {!info!}::Peers")
|
||||
|
|
Loading…
Add table
Reference in a new issue