From 7c7bdaac9b041c5085bb7e1152473b78d8d2eb35 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Sun, 27 May 2012 14:44:37 +0000 Subject: [PATCH] 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 --- src/cli/user.py | 16 ++++++++-------- src/gen/user.py | 18 +++++++++--------- src/gui/user.py | 16 ++++++++-------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/cli/user.py b/src/cli/user.py index fb92f5148..405b2ea13 100644 --- a/src/cli/user.py +++ b/src/cli/user.py @@ -67,9 +67,9 @@ class User(gen.user.User): @type title: str @param message: the message associated with the progress meter @type message: str - @param steps: the total number of steps for the progress meter. a value - of 0 indicates that the ending is unknown and the meter should just - show activity. + @param steps: the total number of steps for the progress meter. + a value of 0 indicates that the ending is unknown and the + meter should just show activity. @type steps: int @returns: none """ @@ -101,8 +101,8 @@ class User(gen.user.User): def prompt(self, title, question): """ - Ask the user a question. The answer must be "yes" or "no". The user will - be forced to answer the question before proceeding. + Ask the user a question. The answer must be "yes" or "no". + The user will be forced to answer the question before proceeding. @param title: the title of the question @type title: str @@ -113,7 +113,7 @@ class User(gen.user.User): """ return False - def warn(self, title, warning): + def warn(self, title, warning=""): """ Warn the user. @@ -125,7 +125,7 @@ class User(gen.user.User): """ print "%s %s" % (title, warning) - def notify_error(self, title, error): + def notify_error(self, title, error=""): """ Notify the user of an error. @@ -135,4 +135,4 @@ class User(gen.user.User): @type error: str @returns: none """ - print "%s %s" % (title, warning) + print "%s %s" % (title, error) diff --git a/src/gen/user.py b/src/gen/user.py index e54e1bff4..90f79b0ca 100644 --- a/src/gen/user.py +++ b/src/gen/user.py @@ -32,8 +32,8 @@ The User class provides basic interaction with the user. class User(): """ 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 - the appropriate interaction (eg. dialogs for GTK, promts for CLI). + This class should be overridden by each respective user interface to + provide the appropriate interaction (eg. dialogs for GTK, prompts for CLI). """ def begin_progress(self, title, message, steps): """ @@ -43,9 +43,9 @@ class User(): @type title: str @param message: the message associated with the progress meter @type message: str - @param steps: the total number of steps for the progress meter. a value - of 0 indicates that the ending is unknown and the meter should just - show activity. + @param steps: the total number of steps for the progress meter. + a value of 0 indicates that the ending is unknown and the + meter should just show activity. @type steps: int @returns: none """ @@ -65,8 +65,8 @@ class User(): def prompt(self, title, question): """ - Ask the user a question. The answer must be "yes" or "no". The user will - be forced to answer the question before proceeding. + Ask the user a question. The answer must be "yes" or "no". + The user will be forced to answer the question before proceeding. @param title: the title of the question @type title: str @@ -77,7 +77,7 @@ class User(): """ return False - def warn(self, title, warning): + def warn(self, title, warning=""): """ Warn the user. @@ -89,7 +89,7 @@ class User(): """ pass - def notify_error(self, title, error): + def notify_error(self, title, error=""): """ Notify the user of an error. diff --git a/src/gui/user.py b/src/gui/user.py index 23f4315ec..d41344926 100644 --- a/src/gui/user.py +++ b/src/gui/user.py @@ -54,9 +54,9 @@ class User(gen.user.User): @type title: str @param message: the message associated with the progress meter @type message: str - @param steps: the total number of steps for the progress meter. a value - of 0 indicates that the ending is unknown and the meter should just - show activity. + @param steps: the total number of steps for the progress meter. + a value of 0 indicates that the ending is unknown and the + meter should just show activity. @type steps: int @returns: none """ @@ -83,8 +83,8 @@ class User(gen.user.User): def prompt(self, title, question): """ - Ask the user a question. The answer must be "yes" or "no". The user will - be forced to answer the question before proceeding. + Ask the user a question. The answer must be "yes" or "no". + The user will be forced to answer the question before proceeding. @param title: the title of the question @type title: str @@ -95,7 +95,7 @@ class User(gen.user.User): """ return False - def warn(self, title, warning): + def warn(self, title, warning=""): """ Warn the user. @@ -107,7 +107,7 @@ class User(gen.user.User): """ WarningDialog(title, warning) - def notify_error(self, title, error): + def notify_error(self, title, error=""): """ Notify the user of an error. @@ -117,4 +117,4 @@ class User(gen.user.User): @type error: str @returns: none """ - ErrorDialog(title, warning) + ErrorDialog(title, error)