Fix #1484: trying to access the screen object when not using interactive mode
This commit is contained in:
parent
8c12c47d3e
commit
b30499c6ac
|
@ -189,10 +189,11 @@ class Command(BaseCommand):
|
||||||
s += " %s" % (fp)
|
s += " %s" % (fp)
|
||||||
# Check if this is too long for the screen and reduce the path
|
# Check if this is too long for the screen and reduce the path
|
||||||
# if necessary
|
# if necessary
|
||||||
cols = self.console.screen.cols
|
if hasattr(self.console, "screen"):
|
||||||
slen = colors.get_line_length(s, self.console.screen.encoding)
|
cols = self.console.screen.cols
|
||||||
if slen > cols:
|
slen = colors.get_line_length(s, self.console.screen.encoding)
|
||||||
s = s.replace(f["path"], f["path"][slen - cols + 1:])
|
if slen > cols:
|
||||||
|
s = s.replace(f["path"], f["path"][slen - cols + 1:])
|
||||||
self.console.write(s)
|
self.console.write(s)
|
||||||
|
|
||||||
self.console.write(" {!info!}::Peers")
|
self.console.write(" {!info!}::Peers")
|
||||||
|
|
Loading…
Reference in New Issue