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
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):
"""
"""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):
"""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):
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.")