From: Nikos Skalkotos Date: Thu, 23 Aug 2012 15:17:06 +0000 (+0300) Subject: Add support for overwriting yes/no button labels X-Git-Tag: v0.1~31 X-Git-Url: https://code.grnet.gr/git/snf-image-creator/commitdiff_plain/b9cd03ee7e3f1a66a25e5c0169a9e8ca7eb016e0 Add support for overwriting yes/no button labels Fix some typos and overwrite the yes/no labels of the wizard/expert mode yesno dialog --- diff --git a/image_creator/dialog_main.py b/image_creator/dialog_main.py index f54a749..2a6463e 100644 --- a/image_creator/dialog_main.py +++ b/image_creator/dialog_main.py @@ -857,9 +857,9 @@ def image_creator(d, media, out): "metadata": metadata} msg = "snf-image-creator detected a %s system on the input media. " \ - "Would you like to run a wizards to assists you through the " \ - "image creation process?\n\nChoose to run the wizard, " \ - " to run the snf-image-creator in expert mode or press " \ + "Would you like to run a wizard to assist you through the " \ + "image creation process?\n\nChoose to run the wizard," \ + " to run the snf-image-creator in expert mode or press " \ "ESC to quit the program." \ % (dev.ostype if dev.ostype == dev.distro else "%s (%s)" % (dev.ostype, dev.distro)) @@ -867,7 +867,8 @@ def image_creator(d, media, out): update_background_title(session) while True: - code = d.yesno(msg, width=YESNO_WIDTH, height=12) + code = d.yesno(msg, width=YESNO_WIDTH, height=12, + yes_label="Wizard", no_label="Expert") if code == d.DIALOG_OK: if wizard(session): break @@ -918,6 +919,13 @@ def main(): dialog._common_args_syntax["extra_label"] = \ lambda string: ("--extra-label", string) + # Allow yes-no label overwriting + dialog._common_args_syntax["yes_label"] = \ + lambda string: ("--yes-label", string) + + dialog._common_args_syntax["no_label"] = \ + lambda string: ("--no-label", string) + usage = "Usage: %prog [options] []" parser = optparse.OptionParser(version=version, usage=usage) parser.add_option("-l", "--logfile", type="string", dest="logfile",