public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-tromey-python:  Fix strings in python-function.c
@ 2008-11-07 22:04 bauermann
  0 siblings, 0 replies; only message in thread
From: bauermann @ 2008-11-07 22:04 UTC (permalink / raw)
  To: archer-commits

The branch, archer-tromey-python has been updated
       via  0081e072ecf751a4cc3b109b381abd8035132989 (commit)
       via  5e69fa95e2044fc843dacea146b3fa1f50507b40 (commit)
      from  2688bd68de27ded2d8520b4108d1b2cc9fa74e7c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 0081e072ecf751a4cc3b109b381abd8035132989
Author: Thiago Jung Bauermann <bauerman@br.ibm.com>
Date:   Fri Nov 7 20:02:03 2008 -0200

    	Fix strings in python-function.c
    	* python/python-function.c (convert_values_to_python, fnpy_call,
    	fnpy_init): Mark strings for translation, fix case and punctuation.

commit 5e69fa95e2044fc843dacea146b3fa1f50507b40
Author: Thiago Jung Bauermann <bauerman@br.ibm.com>
Date:   Fri Nov 7 19:41:18 2008 -0200

    	Fix strings in python/python-cmd.c.
    	* python/python-cmd.c (cmdpy_function, cmdpy_completer,
    	gdbpy_parse_command_name, cmdpy_init): Mark strings for translation,
    	fix case and punctuation.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                |   11 +++++++++++
 gdb/python/python-cmd.c      |   31 ++++++++++++++++---------------
 gdb/python/python-function.c |    8 ++++----
 3 files changed, 31 insertions(+), 19 deletions(-)

First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9246144..24acafa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+2008-11-07  Thiago Jung Bauerman  <bauerman@br.ibm.com>
+
+	* python/python-function.c (convert_values_to_python, fnpy_call,
+	fnpy_init): Mark strings for translation, fix case and punctuation.
+
+2008-11-07  Thiago Jung Bauermann  <bauerman@br.ibm.com>
+
+	* python/python-cmd.c (cmdpy_function, cmdpy_completer,
+	gdbpy_parse_command_name, cmdpy_init): Mark strings for translation,
+	fix case and punctuation.
+
 2008-11-07  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	PR gdb/931
diff --git a/gdb/python/python-cmd.c b/gdb/python/python-cmd.c
index 58e79da..6c5b144 100644
--- a/gdb/python/python-cmd.c
+++ b/gdb/python/python-cmd.c
@@ -101,9 +101,9 @@ cmdpy_function (struct cmd_list_element *command, char *args, int from_tty)
   PyObject *argobj, *ttyobj, *result;
 
   if (! obj)
-    error ("Invalid invocation of Python command object");
+    error (_("Invalid invocation of Python command object."));
   if (! PyObject_HasAttr ((PyObject *) obj, invoke_cst))
-    error ("Python command object missing 'invoke' method");
+    error (_("Python command object missing 'invoke' method."));
 
   if (! args)
     {
@@ -114,7 +114,7 @@ cmdpy_function (struct cmd_list_element *command, char *args, int from_tty)
     {
       argobj = PyString_FromString (args);
       if (! argobj)
-	error ("Couldn't convert arguments to Python string");
+	error (_("Could not convert arguments to Python string."));
     }
   ttyobj = from_tty ? Py_True : Py_False;
   Py_INCREF (ttyobj);
@@ -138,13 +138,13 @@ cmdpy_function (struct cmd_list_element *command, char *args, int from_tty)
 
 	  PyErr_Restore (ptype, pvalue, ptraceback);
 	  gdbpy_print_stack ();
-	  error ("Error occurred in Python command: %s", copy);
+	  error (_("Error occurred in Python command: %s"), copy);
 	}
       else
 	{
 	  PyErr_Restore (ptype, pvalue, ptraceback);
 	  gdbpy_print_stack ();
-	  error ("Error occurred in Python command");
+	  error (_("Error occurred in Python command."));
 	}
     }
   Py_DECREF (result);
@@ -159,7 +159,7 @@ cmdpy_completer (struct cmd_list_element *command, char *text, char *word)
   char **result;
 
   if (! obj)
-    error ("Invalid invocation of Python command object");
+    error (_("Invalid invocation of Python command object."));
   if (! PyObject_HasAttr ((PyObject *) obj, complete_cst))
     {
       /* If there is no complete method, don't error -- instead, just
@@ -169,10 +169,10 @@ cmdpy_completer (struct cmd_list_element *command, char *text, char *word)
 
   textobj = PyString_FromString (text);
   if (! textobj)
-    error ("could not convert argument to Python string");
+    error (_("Could not convert argument to Python string."));
   wordobj = PyString_FromString (word);
   if (! wordobj)
-    error ("could not convert argument to Python string");
+    error (_("Could not convert argument to Python string."));
 
   resultobj = PyObject_CallMethodObjArgs ((PyObject *) obj, complete_cst,
 					  textobj, wordobj, NULL);
@@ -253,7 +253,7 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
     ;
   if (i < 0)
     {
-      PyErr_SetString (PyExc_RuntimeError, "no command name found");
+      PyErr_SetString (PyExc_RuntimeError, _("no command name found"));
       return NULL;
     }
   lastchar = i;
@@ -285,7 +285,7 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
   elt = lookup_cmd_1 (&text, *start_list, NULL, 1);
   if (!elt || elt == (struct cmd_list_element *) -1)
     {
-      PyErr_Format (PyExc_RuntimeError, "could not find command prefix %s",
+      PyErr_Format (PyExc_RuntimeError, _("could not find command prefix %s"),
 		    prefix_text);
       xfree (prefix_text);
       xfree (result);
@@ -299,7 +299,7 @@ gdbpy_parse_command_name (char *text, struct cmd_list_element ***base_list,
       return result;
     }
 
-  PyErr_Format (PyExc_RuntimeError, "'%s' is not a prefix command",
+  PyErr_Format (PyExc_RuntimeError, _("'%s' is not a prefix command"),
 		prefix_text);
   xfree (prefix_text);
   xfree (result);
@@ -341,7 +341,8 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
     {
       /* Note: this is apparently not documented in Python.  We return
 	 0 for success, -1 for failure.  */
-      PyErr_Format (PyExc_RuntimeError, "Command object already initialized");
+      PyErr_Format (PyExc_RuntimeError,
+		    _("command object already initialized"));
       return -1;
     }
 
@@ -355,13 +356,13 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
       && cmdtype != class_trace && cmdtype != class_obscure
       && cmdtype != class_maintenance)
     {
-      PyErr_Format (PyExc_RuntimeError, "invalid command class argument");
+      PyErr_Format (PyExc_RuntimeError, _("invalid command class argument"));
       return -1;
     }
 
   if (completetype < -1 || completetype >= (int) N_COMPLETERS)
     {
-      PyErr_Format (PyExc_RuntimeError, "invalid completion type argument");
+      PyErr_Format (PyExc_RuntimeError, _("invalid completion type argument"));
       return -1;
     }
 
@@ -376,7 +377,7 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kwds)
 	docstring = python_string_to_host_string (ds_obj);
     }
   if (! docstring)
-    docstring = xstrdup ("This command is not documented.");
+    docstring = xstrdup (_("This command is not documented."));
 
   Py_INCREF (self);
 
diff --git a/gdb/python/python-function.c b/gdb/python/python-function.c
index c82a13b..bc93e57 100644
--- a/gdb/python/python-function.c
+++ b/gdb/python/python-function.c
@@ -1,4 +1,4 @@
-/* gdb commands implemented in Python
+/* Convenience functions implemented in Python.
 
    Copyright (C) 2008 Free Software Foundation, Inc.
 
@@ -43,7 +43,7 @@ convert_values_to_python (int argc, struct value **argv)
       if (! elt)
 	{
 	  Py_DECREF (result);
-	  error ("could not convert value to Python object");
+	  error (_("Could not convert value to Python object."));
 	}
       PyTuple_SetItem (result, i, elt);
     }
@@ -66,7 +66,7 @@ fnpy_call (void *cookie, int argc, struct value **argv)
   if (! callable)
     {
       Py_DECREF (args);
-      error ("no method named 'invoke' in object");
+      error _(("No method named 'invoke' in object."));
     }
 
   result = PyObject_Call (callable, args, NULL);
@@ -119,7 +119,7 @@ fnpy_init (PyObject *self, PyObject *args, PyObject *kwds)
 	docstring = python_string_to_host_string (ds_obj);
     }
   if (! docstring)
-    docstring = "This command is not documented.";
+    docstring = _("This function is not documented.");
 
   add_internal_function (name, docstring, fnpy_call, self, fnpy_destroy);
   return 0;


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-07 22:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-07 22:04 [SCM] archer-tromey-python: Fix strings in python-function.c bauermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).