From 4d2a0b18563a4d80db53bf33e6c95e092811112e Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 16 Jan 2011 15:58:50 -0800 Subject: [PATCH] Fix #1484: trying to access the screen object when not using interactive mode --- deluge/ui/console/commands/info.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/deluge/ui/console/commands/info.py b/deluge/ui/console/commands/info.py index 8a478a87d..d42a80eeb 100644 --- a/deluge/ui/console/commands/info.py +++ b/deluge/ui/console/commands/info.py @@ -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")