Author: andar
Revision: 5669
Log:
Fix print torrent info to the console
Diff:
Modified: trunk/deluge/ui/console/commands/info.py
===================================================================
--- trunk/deluge/ui/console/commands/info.py 2009-08-14 23:11:22 UTC (rev
5668)
+++ trunk/deluge/ui/console/commands/info.py 2009-08-16 17:13:34 UTC (rev
5669)
@@ -162,7 +162,12 @@
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)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---