X-Git-Url: https://code.grnet.gr/git/snf-image-creator/blobdiff_plain/88f83027df65608a70e1a88f96b4a3055427dd52..89efe927d17f8193cfad1879cc83f390babae871:/image_creator/output/dialog.py diff --git a/image_creator/output/dialog.py b/image_creator/output/dialog.py index 2790b1c..a82b986 100644 --- a/image_creator/output/dialog.py +++ b/image_creator/output/dialog.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- +# # Copyright 2012 GRNET S.A. All rights reserved. # # Redistribution and use in source and binary forms, with or @@ -31,6 +33,8 @@ # interpreted as representing official policies, either expressed # or implied, of GRNET S.A. +"""This module provides various dialog-based Output classes""" + from image_creator.output import Output import time import fcntl @@ -127,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() - 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)