Module: deluge Branch: 1.3-stable Commit: 4d2a0b18563a4d80db53bf33e6c95e092811112e
Author: Andrew Resch <[email protected]> Date: Sun Jan 16 15:58:50 2011 -0800 Fix #1484: trying to access the screen object when not using interactive mode --- deluge/ui/console/commands/info.py | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/deluge/ui/console/commands/info.py b/deluge/ui/console/commands/info.py index 8a478a8..d42a80e 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") -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
