[glom] rint exception messages to stdout.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Subject: [glom] rint exception messages to stdout.
- Date: Sun, 28 Jun 2009 17:46:27 +0000 (UTC)
commit 3709e10cf26b24bc9f00a9ae9a7dfe962a9169b4
Author: Murray Cumming <murrayc murrayc com>
Date: Sun Jun 28 19:46:17 2009 +0200
rint exception messages to stdout.
* ldtp/database-creation/create-db.py: When catching the exception,
print it to stdout, because it does not seem to appear in the log file.
* ldtp/common.py: Corrected the English of some exception messages.
ChangeLog | 8 ++++++++
ldtp/common.py | 6 +++---
ldtp/database-creation/create-db.py | 22 ++++++++++++++--------
3 files changed, 25 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 48639d3..c0777a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2009-06-28 Murray Cumming <murrayc murrayc com>
+ Print exception messages to stdout.
+
+ * ldtp/database-creation/create-db.py: When catching the exception,
+ print it to stdout, because it does not seem to appear in the log file.
+ * ldtp/common.py: Corrected the English of some exception messages.
+
+2009-06-28 Murray Cumming <murrayc murrayc com>
+
Fix an error check.
* glom/xsl_utils.cc: transform_and_open(): Fix the check for a failed
diff --git a/ldtp/common.py b/ldtp/common.py
index 7d1078e..61d9406 100644
--- a/ldtp/common.py
+++ b/ldtp/common.py
@@ -32,9 +32,9 @@ def launch_glom():
# code for each window.
# Wildcard (* and ?) can be used.
if ldtp.waittillguiexist(main_window) == 0:
- raise ldtp.LdtpExecutionError('Glom main window does not show up')
+ raise ldtp.LdtpExecutionError('The Glom main window did not appear.')
if ldtp.waittillguiexist(initial_dialog) == 0:
- raise ldtp.LdtpExecutionError('Glom initial dialog does not show up')
+ raise ldtp.LdtpExecutionError('The Glom initial dialog did not appear.')
def exit_glom():
ldtp.selectmenuitem(main_window, 'mnuFile;mnuClose')
@@ -61,7 +61,7 @@ def read_central_info():
def enter_connection_credentials(backend_name):
if backend_name == 'PostgresCentral':
if ldtp.waittillguiexist('Connection Details') == 0:
- raise ldtp.LdtpExecutionError('Connection details dialog does not show up')
+ raise ldtp.LdtpExecutionError('The Glom connection details dialog did not appear.')
(hostname, username, password) = read_central_info()
diff --git a/ldtp/database-creation/create-db.py b/ldtp/database-creation/create-db.py
index 0c6e0e8..fe04a1c 100755
--- a/ldtp/database-creation/create-db.py
+++ b/ldtp/database-creation/create-db.py
@@ -13,7 +13,7 @@ import gda
def delete_database(backend):
if backend == 'PostgresCentral':
- # Read glom file to find out database name and port
+ # Read the glom file to find out the database name and port:
xml_info = []
def start_element(name, attrs):
@@ -34,7 +34,7 @@ def delete_database(backend):
(database, port) = (xml_info[0], xml_info[1])
(hostname, username, password) = common.read_central_info()
- # Remove the database from the central PostgreSQL server
+ # Remove the database from the central PostgreSQL server:
op = gda.gda_prepare_drop_database('PostgreSQL', database)
op.set_value_at('/SERVER_CNX_P/HOST', hostname)
op.set_value_at('/SERVER_CNX_P/PORT', port)
@@ -97,7 +97,7 @@ try:
# Wait for the file chooser dialog to appear:
if waittillguiexist(creation_dialog) == 0:
- raise LdtpExecutionError('File chooser does not show up')
+ raise LdtpExecutionError('The file chooser dialog does not appear.')
# Navigate into the newly created folder:
doubleclickrow(creation_dialog, 'tblFiles', 'TestDatabase')
@@ -112,7 +112,7 @@ try:
# Acknowledge the dialog:
click(creation_dialog, 'btnSave')
- # Enter the connection credentials for the centrally hosted database
+ # Enter the connection credentials for the centrally hosted database:
common.enter_connection_credentials(backend)
if not example:
@@ -150,7 +150,7 @@ try:
# Buttons (prefix: 'btn') are addressed via their label text:
click(common.initial_dialog, 'btnSelect')
- # Enter the connection credentials for the centrally hosted database
+ # Enter the connection credentials for the centrally hosted database:
common.enter_connection_credentials(backend)
# Wait until the database has been opened:
@@ -165,17 +165,23 @@ try:
common.exit_glom()
# Wait until Glom has cleaned up everything, so that removing the
- # test database is going to work.
+ # test database is going to work:
wait(2)
- # Remove the test database again
+ # Remove the test database again:
delete_database(backend)
except LdtpExecutionError, msg:
log(msg, 'fail')
+ # Print the exception to stdout because it does not seem to appear
+ # in the log file: TODO: Fix that. murrayc.
+ print "LdtpExecutionError:"
+ print msg
+ print "\n"
+
# Remove the created directory also on error, so that the test
- # does not fail because of the database already existing next time
+ # does not fail because of the database already existing next time:
delete_database(backend)
raise LdtpExecutionError (msg)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]