Fix a bug in InfoBoxOutput class
authorNikos Skalkotos <skalkoto@grnet.gr>
Wed, 8 Jan 2014 09:52:00 +0000 (11:52 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Wed, 8 Jan 2014 09:52:00 +0000 (11:52 +0200)
If the text was more lines that the height of the active region in the dialog
the 2 last lines were not displayed.

image_creator/output/dialog.py

index f2b10e8..a82b986 100644 (file)
@@ -131,7 +131,9 @@ class InfoBoxOutput(Output):
         self.msg += "%s%s" % (msg, nl)
         # If output is long, only output the last lines that fit in the box
         lines = self.msg.splitlines()
         self.msg += "%s%s" % (msg, nl)
         # If output is long, only output the last lines that fit in the box
         lines = self.msg.splitlines()
-        h = self.height
+        # The height of the active region is 2 lines shorter that the height of
+        # the dialog
+        h = self.height - 2
         display = self.msg if len(lines) <= h else "\n".join(lines[-h:])
         self.d.infobox(display, title=self.title, height=self.height,
                        width=self.width)
         display = self.msg if len(lines) <= h else "\n".join(lines[-h:])
         self.d.infobox(display, title=self.title, height=self.height,
                        width=self.width)