From 06ecfceb74463ca9b18707fd8eb21a47f50a11bd Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 16 Aug 2009 17:13:34 +0000 Subject: [PATCH] Fix print torrent info to the console --- deluge/ui/console/commands/info.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/commands/info.py b/deluge/ui/console/commands/info.py index dc2b5bf73..b4350f22e 100644 --- a/deluge/ui/console/commands/info.py +++ b/deluge/ui/console/commands/info.py @@ -162,7 +162,12 @@ class Command(BaseCommand): self.console.write(s) if not status["is_finished"]: - pbar = format_progressbar(status["progress"], self.console.screen.cols - (13 + len("%.2f%%" % status["progress"]))) + if hasattr(self.console, "screen"): + cols = self.console.screen.cols + else: + cols = 80 + + pbar = format_progressbar(status["progress"], cols - (13 + len("%.2f%%" % status["progress"]))) s = "{!info!}Progress: {!input!}%.2f%% %s" % (status["progress"], pbar) self.console.write(s)