permit only one argument to user.warn and user.notify_error

since second arguments are optional in both ErrorDialog and
WarningDialog (so some errors and warnings have only one)


svn: r19674
This commit is contained in:
Paul Franklin
2012-05-27 14:44:37 +00:00
parent aa15862b81
commit 7c7bdaac9b
3 changed files with 25 additions and 25 deletions

View File

@@ -67,9 +67,9 @@ class User(gen.user.User):
@type title: str @type title: str
@param message: the message associated with the progress meter @param message: the message associated with the progress meter
@type message: str @type message: str
@param steps: the total number of steps for the progress meter. a value @param steps: the total number of steps for the progress meter.
of 0 indicates that the ending is unknown and the meter should just a value of 0 indicates that the ending is unknown and the
show activity. meter should just show activity.
@type steps: int @type steps: int
@returns: none @returns: none
""" """
@@ -101,8 +101,8 @@ class User(gen.user.User):
def prompt(self, title, question): def prompt(self, title, question):
""" """
Ask the user a question. The answer must be "yes" or "no". The user will Ask the user a question. The answer must be "yes" or "no".
be forced to answer the question before proceeding. The user will be forced to answer the question before proceeding.
@param title: the title of the question @param title: the title of the question
@type title: str @type title: str
@@ -113,7 +113,7 @@ class User(gen.user.User):
""" """
return False return False
def warn(self, title, warning): def warn(self, title, warning=""):
""" """
Warn the user. Warn the user.
@@ -125,7 +125,7 @@ class User(gen.user.User):
""" """
print "%s %s" % (title, warning) print "%s %s" % (title, warning)
def notify_error(self, title, error): def notify_error(self, title, error=""):
""" """
Notify the user of an error. Notify the user of an error.
@@ -135,4 +135,4 @@ class User(gen.user.User):
@type error: str @type error: str
@returns: none @returns: none
""" """
print "%s %s" % (title, warning) print "%s %s" % (title, error)

View File

@@ -32,8 +32,8 @@ The User class provides basic interaction with the user.
class User(): class User():
""" """
This class provides a means to interact with the user in an abstract way. This class provides a means to interact with the user in an abstract way.
This class should be overridden by each respective user interface to provide This class should be overridden by each respective user interface to
the appropriate interaction (eg. dialogs for GTK, promts for CLI). provide the appropriate interaction (eg. dialogs for GTK, prompts for CLI).
""" """
def begin_progress(self, title, message, steps): def begin_progress(self, title, message, steps):
""" """
@@ -43,9 +43,9 @@ class User():
@type title: str @type title: str
@param message: the message associated with the progress meter @param message: the message associated with the progress meter
@type message: str @type message: str
@param steps: the total number of steps for the progress meter. a value @param steps: the total number of steps for the progress meter.
of 0 indicates that the ending is unknown and the meter should just a value of 0 indicates that the ending is unknown and the
show activity. meter should just show activity.
@type steps: int @type steps: int
@returns: none @returns: none
""" """
@@ -65,8 +65,8 @@ class User():
def prompt(self, title, question): def prompt(self, title, question):
""" """
Ask the user a question. The answer must be "yes" or "no". The user will Ask the user a question. The answer must be "yes" or "no".
be forced to answer the question before proceeding. The user will be forced to answer the question before proceeding.
@param title: the title of the question @param title: the title of the question
@type title: str @type title: str
@@ -77,7 +77,7 @@ class User():
""" """
return False return False
def warn(self, title, warning): def warn(self, title, warning=""):
""" """
Warn the user. Warn the user.
@@ -89,7 +89,7 @@ class User():
""" """
pass pass
def notify_error(self, title, error): def notify_error(self, title, error=""):
""" """
Notify the user of an error. Notify the user of an error.

View File

@@ -54,9 +54,9 @@ class User(gen.user.User):
@type title: str @type title: str
@param message: the message associated with the progress meter @param message: the message associated with the progress meter
@type message: str @type message: str
@param steps: the total number of steps for the progress meter. a value @param steps: the total number of steps for the progress meter.
of 0 indicates that the ending is unknown and the meter should just a value of 0 indicates that the ending is unknown and the
show activity. meter should just show activity.
@type steps: int @type steps: int
@returns: none @returns: none
""" """
@@ -83,8 +83,8 @@ class User(gen.user.User):
def prompt(self, title, question): def prompt(self, title, question):
""" """
Ask the user a question. The answer must be "yes" or "no". The user will Ask the user a question. The answer must be "yes" or "no".
be forced to answer the question before proceeding. The user will be forced to answer the question before proceeding.
@param title: the title of the question @param title: the title of the question
@type title: str @type title: str
@@ -95,7 +95,7 @@ class User(gen.user.User):
""" """
return False return False
def warn(self, title, warning): def warn(self, title, warning=""):
""" """
Warn the user. Warn the user.
@@ -107,7 +107,7 @@ class User(gen.user.User):
""" """
WarningDialog(title, warning) WarningDialog(title, warning)
def notify_error(self, title, error): def notify_error(self, title, error=""):
""" """
Notify the user of an error. Notify the user of an error.
@@ -117,4 +117,4 @@ class User(gen.user.User):
@type error: str @type error: str
@returns: none @returns: none
""" """
ErrorDialog(title, warning) ErrorDialog(title, error)