[glom] Remove more small traces of pygda.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Remove more small traces of pygda.
- Date: Tue, 5 Apr 2011 13:46:35 +0000 (UTC)
commit c5ecd006ecd6f1f678cbc8d5297cbbe99f506f27
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Apr 5 15:41:51 2011 +0200
Remove more small traces of pygda.
* glom/libglom/python_embed/py_glom_record.cc:
* glom/python_embed/glom_python.cc:
* glom/python_embed/python_module/py_glom_module.cc: Some last minor renames
from pygda to gi.repository.Gda.
ChangeLog | 9 +++++
glom/libglom/python_embed/py_glom_record.cc | 2 +-
glom/python_embed/glom_python.cc | 36 ++++++++++----------
glom/python_embed/python_module/py_glom_module.cc | 2 +-
4 files changed, 29 insertions(+), 20 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e249748..820a390 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2011-04-05 Murray Cumming <murrayc murrayc com>
+ Remove more small traces of pygda.
+
+ * glom/libglom/python_embed/py_glom_record.cc:
+ * glom/python_embed/glom_python.cc:
+ * glom/python_embed/python_module/py_glom_module.cc: Some last minor renames
+ from pygda to gi.repository.Gda.
+
+2011-04-05 Murray Cumming <murrayc murrayc com>
+
Python: Use gi.repository.Gda instead of Gda.
* configure.ac: Do not require pygda at build time, though we check for it
diff --git a/glom/libglom/python_embed/py_glom_record.cc b/glom/libglom/python_embed/py_glom_record.cc
index fe145be..e29e004 100644
--- a/glom/libglom/python_embed/py_glom_record.cc
+++ b/glom/libglom/python_embed/py_glom_record.cc
@@ -65,7 +65,7 @@ boost::python::object PyGlomRecord::get_connection()
if(m_connection)
{
//Ask pygobject to create a PyObject* that wraps our GObject,
- //presumably using something from pygda:
+ //presumably using something from gi.repository.Gda:
PyObject* cobject = pygobject_new( G_OBJECT(m_connection->gobj()) );
result = boost::python::object( boost::python::borrowed(cobject) );
}
diff --git a/glom/python_embed/glom_python.cc b/glom/python_embed/glom_python.cc
index 5ae12b7..0cae289 100644
--- a/glom/python_embed/glom_python.cc
+++ b/glom/python_embed/glom_python.cc
@@ -133,7 +133,7 @@ static Glib::ustring get_traceback()
result = chrRetval;
g_free(chrRetval);
}
-
+
return result;
}
@@ -148,7 +148,7 @@ static void ShowTrace()
*/
static boost::python::object import_module(const char* name)
{
- boost::python::object module_glom; //Defaults to PyNone.
+ boost::python::object module_glom; //Defaults to PyNone.
try
{
module_glom = boost::python::import(name);
@@ -190,9 +190,9 @@ bool gda_python_module_is_available()
static boost::python::object glom_python_call(Field::glom_field_type result_type,
Document* pDocument,
- const Glib::ustring& func_impl,
+ const Glib::ustring& func_impl,
Glib::ustring& error_message,
- const boost::python::object& param1,
+ const boost::python::object& param1,
const boost::python::object& param2 = boost::python::object())
{
//std::cout << "glom_evaluate_python_function_implementation()" << std::endl;
@@ -225,9 +225,9 @@ static boost::python::object glom_python_call(Field::glom_field_type result_type
func_signature = func_name + "(record)";
else
func_signature = func_name + "(record, ui)";
-
+
func_def = "def " + func_signature + ":\n import glom_" GLOM_ABI_VERSION_UNDERLINED "\n from gi.repository import Gda\n" + func_def;
-
+
//We did this in main(): Py_Initialize();
boost::python::object pMain = import_module("__main__");
@@ -281,7 +281,7 @@ static boost::python::object glom_python_call(Field::glom_field_type result_type
boost::python::object module_gda = import_module("gi.repository.Gda");
if(module_gda == boost::python::object())
{
- g_warning("Could not import python gda module.");
+ g_warning("Could not import python gi.repository.Gda module.");
return boost::python::object();
}
@@ -375,11 +375,11 @@ static boost::python::object glom_python_call(Field::glom_field_type result_type
g_warning("pyResult.ptr() was null");
HandlePythonError();
}
-
+
//TODO: Why do we do this?
Py_FlushLine();
PyErr_Clear();
-
+
//We did this in main(): Py_Finalize();
return pyResultCpp;
@@ -402,14 +402,14 @@ void glom_execute_python_function_implementation(const Glib::ustring& func_impl,
g_warning("Could not import python glom module.");
return; // don't crash
}
-
+
boost::python::object objRecord(new PyGlomRecord);
boost::python::extract<PyGlomRecord*> extractor(objRecord);
if(!extractor.check())
{
std::cerr << ("extract<PyGlomRecord*> failed.") << std::endl;
}
-
+
PyGlomRecord* pParam = extractor;
if(pParam)
{
@@ -417,7 +417,7 @@ void glom_execute_python_function_implementation(const Glib::ustring& func_impl,
pParam->set_fields(field_values, pDocument, table_name, key_field, key_field_value, opened_connection);
pParam->set_read_only();
}
-
+
//Pass an additional ui parameter for use by scripts:
boost::python::object objUI(new PyGlomUI(callbacks));
@@ -441,25 +441,25 @@ Gnome::Gda::Value glom_evaluate_python_function_implementation(Field::glom_field
g_warning("Could not import python glom module.");
return Gnome::Gda::Value(); // don't crash
}
-
+
boost::python::object objRecord(new PyGlomRecord);
-
+
boost::python::extract<PyGlomRecord*> extractor(objRecord);
if(!extractor.check())
{
std::cerr << ("extract<PyGlomRecord*> failed.") << std::endl;
return Gnome::Gda::Value();
}
-
+
PyGlomRecord* pParam = extractor;
if(pParam)
{
//Fill the record's details:
pParam->set_fields(field_values, pDocument, table_name, key_field, key_field_value, opened_connection);
}
-
+
const boost::python::object pyResultCpp = glom_python_call(result_type, pDocument, func_impl, error_message, objRecord);
-
+
//Deal with the various possible return types:
Gnome::Gda::Value valueResult;
bool object_is_gda_value = false;
@@ -519,7 +519,7 @@ Gnome::Gda::Value glom_evaluate_python_function_implementation(Field::glom_field
HandlePythonError();
}
}
-
+
return valueResult;
}
diff --git a/glom/python_embed/python_module/py_glom_module.cc b/glom/python_embed/python_module/py_glom_module.cc
index 415a076..71a5a62 100644
--- a/glom/python_embed/python_module/py_glom_module.cc
+++ b/glom/python_embed/python_module/py_glom_module.cc
@@ -87,7 +87,7 @@ BOOST_PYTHON_MODULE(glom_1_20)
.add_property("table_name", &PyGlomRecord::get_table_name,
"The name of the current table as a string.")
.add_property("connection", &PyGlomRecord::get_connection,
- "The current database connection for use with the pygda API. This is a :class:`Gda.Connection` object.")
+ "The current database connection for use with the gi.repository.Gda API. This is a :class:`Gda.Connection` object.")
.add_property("related", &PyGlomRecord::get_related,
":class:`Related` records. Use the ['relationship_name'] notation with this object.")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]