]> scripts.mit.edu Git - wizard.git/commitdiff
Improve wording of prompts.
authorEdward Z. Yang <ezyang@mit.edu>
Thu, 5 Nov 2009 06:03:59 +0000 (01:03 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Thu, 5 Nov 2009 06:03:59 +0000 (01:03 -0500)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
wizard/install/__init__.py
wizard/install/interactive.py

index bce756b1b60c7f17c17af7758f9f6b72d74e0fca..bec70d8428fd2ab6d9df15c397a1626f79f8c468 100644 (file)
@@ -167,6 +167,8 @@ class Arg(object):
     name = None
     #: Help string
     help = None
+    #: String to display if prompting a user for a value
+    prompt = None
     #: String "type" of the argument, used for metavar
     type = None
     #: If true, is a password
@@ -185,6 +187,8 @@ class Arg(object):
             if not hasattr(self, k):
                 raise TypeError("Arg() got unexpected keyword argument '%s'" % k)
             setattr(self, k, v)
+        if self.prompt is None:
+            self.prompt = self.help
 
 class ArgSet(object):
     """
@@ -221,8 +225,10 @@ class AdminArgSet(ArgSet):
     """Common arguments when an admin account is to be created."""
     def __init__(self):
         self.args = [
-                Arg("admin_name", type="NAME", help="Name of admin user to create"),
-                Arg("admin_password", type="PWD", password=True, help="Password of admin user"),
+                Arg("admin_name", type="NAME", help="Name of admin user to create",
+                    prompt="You will be able to log in using a username of your choice.  Please decide on a username and enter it below."),
+                Arg("admin_password", type="PWD", password=True, help="Password of admin user",
+                    prompt="Please decide on an admin password."),
                 ]
 
 class EmailArgSet(ArgSet):
@@ -236,7 +242,8 @@ class TitleArgSet(ArgSet):
     """Common arguments when a title is required."""
     def __init__(self):
         self.args = [
-                Arg("title", help="Title of your new site"),
+                Arg("title", help="Title of your new site",
+                    prompt="Please decide on a title for your new website."),
                 ]
 
 class ArgSchema(object):
index 37ce807aa5611df8d22758cb0f6a20e770b3ade4..c8338cd9b01dfafb36a899b89bd711e6038875ad 100644 (file)
@@ -20,10 +20,10 @@ class Controller(object):
             if getattr(options, name) is not None:
                 continue
             if not arg.password:
-                val = self.input.inputbox(arg.help + "\n\n" + humanize(name) + ":")
+                val = self.input.inputbox(arg.prompt + "\n\n" + humanize(name) + ":")
             else:
                 while 1:
-                    val = self.input.passwordbox(arg.help + "\n\n" + humanize(name) + " (cursor will not move):")
+                    val = self.input.passwordbox(arg.prompt + "\n\n" + humanize(name) + " (cursor will not move):")
                     val2 = self.input.passwordbox("Please enter the password again (cursor will not move):")
                     if val != val2:
                         self.input.msgbox("Passwords didn't match.")