[pygobject] refactor, add objects and types to the correct internal module
- From: John Palmieri <johnp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] refactor, add objects and types to the correct internal module
- Date: Thu, 11 Aug 2011 12:49:01 +0000 (UTC)
commit fbd4a8263260c187211799454c08b1e55e2cb998
Author: John (J5) Palmieri <johnp redhat com>
Date: Fri Jul 22 12:27:41 2011 -0400
refactor, add objects and types to the correct internal module
https://bugzilla.gnome.org/show_bug.cgi?id=642048
gi/_glib/pygiochannel.c | 38 +++++++++++++++++++-------------------
gi/_glib/pygmaincontext.c | 2 +-
gi/_glib/pygmainloop.c | 4 ++--
gi/_glib/pygoptioncontext.c | 4 ++--
gi/_glib/pygoptiongroup.c | 4 ++--
gi/_glib/pygsource.c | 14 +++++++-------
gi/_glib/pygspawn.c | 14 +++++++-------
7 files changed, 40 insertions(+), 40 deletions(-)
---
diff --git a/gi/_glib/pygiochannel.c b/gi/_glib/pygiochannel.c
index f7e2bc4..4f77e28 100644
--- a/gi/_glib/pygiochannel.c
+++ b/gi/_glib/pygiochannel.c
@@ -18,7 +18,7 @@ typedef struct {
int softspace; /* to make print >> chan, "foo" ... work */
} PyGIOChannel;
-PYGLIB_DEFINE_TYPE("glib.IOChannel", PyGIOChannel_Type, PyGIOChannel)
+PYGLIB_DEFINE_TYPE("gi._glib.IOChannel", PyGIOChannel_Type, PyGIOChannel)
static PyObject*
py_io_channel_next(PyGIOChannel *self)
@@ -87,7 +87,7 @@ py_io_channel_shutdown(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
PyObject* flush = Py_True;
GError* error = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:glib.IOChannel.shutdown", kwlist, &flush))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:gi._glib.IOChannel.shutdown", kwlist, &flush))
return NULL;
ret = g_io_channel_shutdown(self->channel, PyObject_IsTrue(flush), &error);
@@ -106,7 +106,7 @@ py_io_channel_set_buffer_size(PyGIOChannel* self, PyObject *args, PyObject *kwar
static char *kwlist[] = { "size", NULL };
int size;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:glib.IOChannel.set_buffer_size", kwlist, &size))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:gi._glib.IOChannel.set_buffer_size", kwlist, &size))
return NULL;
g_io_channel_set_buffer_size(self->channel, size);
@@ -127,7 +127,7 @@ py_io_channel_set_buffered(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
static char *kwlist[] = { "buffered", NULL };
int buffered;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:glib.IOChannel.set_buffered", kwlist, &buffered))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:gi._glib.IOChannel.set_buffered", kwlist, &buffered))
return NULL;
g_io_channel_set_buffered(self->channel, buffered);
@@ -149,7 +149,7 @@ py_io_channel_set_encoding(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
const char* encoding;
GError* error = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z:glib.IOChannel.set_encoding", kwlist, &encoding))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z:gi._glib.IOChannel.set_encoding", kwlist, &encoding))
return NULL;
g_io_channel_set_encoding(self->channel, encoding, &error);
@@ -185,7 +185,7 @@ py_io_channel_read_chars(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
GError* error = NULL;
GIOStatus status = G_IO_STATUS_NORMAL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:glib.IOChannel.read", kwlist, &max_count))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:gi._glib.IOChannel.read", kwlist, &max_count))
return NULL;
if (max_count == 0)
@@ -266,7 +266,7 @@ py_io_channel_write_chars(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
GError* error = NULL;
GIOStatus status;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#:glib.IOChannel.write",
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#:gi._glib.IOChannel.write",
kwlist, &buf, &buf_len))
return NULL;
@@ -290,7 +290,7 @@ py_io_channel_write_lines(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
GIOStatus status;
PyObject *iter, *value, *pylines;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:glib.IOChannel.writelines",
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gi._glib.IOChannel.writelines",
kwlist, &pylines))
return NULL;
@@ -303,7 +303,7 @@ py_io_channel_write_lines(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
goto normal_exit;
}
if (!PYGLIB_PyUnicode_Check(value)) {
- PyErr_SetString(PyExc_TypeError, "glib.IOChannel.writelines must"
+ PyErr_SetString(PyExc_TypeError, "gi._glib.IOChannel.writelines must"
" be sequence/iterator of strings");
Py_DECREF(iter);
return NULL;
@@ -347,7 +347,7 @@ py_io_channel_set_flags(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
GIOStatus status;
GError* error = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:glib.IOChannel.set_flags",
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:gi._glib.IOChannel.set_flags",
kwlist, &flags))
return NULL;
@@ -376,7 +376,7 @@ py_io_channel_set_close_on_unref(PyGIOChannel* self, PyObject *args, PyObject *k
static char *kwlist[] = { "do_close", NULL };
PyObject *do_close;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:glib.IOChannel.set_close_on_unref",
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gi._glib.IOChannel.set_close_on_unref",
kwlist, &do_close))
return NULL;
@@ -460,7 +460,7 @@ py_io_channel_add_watch(PyObject *self, PyObject *args, PyObject *kwargs)
PyGIOWatchData *data;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "iO|Oi:glib.IOChannel.add_watch",
+ "iO|Oi:gi._glib.IOChannel.add_watch",
kwlist, &condition, &callback,
&user_data, &priority))
return NULL;
@@ -498,7 +498,7 @@ py_io_channel_win32_poll(PyObject *self, PyObject *args, PyObject *kwargs)
gint result;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "O!|i:glib.IOChannel.win32_poll",
+ "O!|i:gi._glib.IOChannel.win32_poll",
kwlist, &PyList_Type, &pyfds, &timeout))
return NULL;
@@ -507,7 +507,7 @@ py_io_channel_win32_poll(PyObject *self, PyObject *args, PyObject *kwargs)
for (i = 0; i < len; ++i) {
pyfd = PyList_GET_ITEM(pyfds, i);
if (!PyObject_TypeCheck(pyfd, &PyGPollFD_Type)) {
- PyErr_SetString(PyExc_TypeError, "'fds' must be a list of glib.PollFD objects");
+ PyErr_SetString(PyExc_TypeError, "'fds' must be a list of gi._glib.PollFD objects");
return NULL;
}
pollfd[i] = ((PyGPollFD *) pyfd)->pollfd;
@@ -530,7 +530,7 @@ py_io_channel_win32_make_pollfd(PyObject *self, PyObject *args, PyObject *kwargs
PyGPollFD *pypollfd;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "i:glib.IOChannel.win32_make_pollfd",
+ "i:gi._glib.IOChannel.win32_make_pollfd",
kwlist, &condition))
return NULL;
@@ -554,7 +554,7 @@ py_io_channel_read_line(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
gint size_hint = -1;
GIOStatus status;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:glib.IOChannel.readline", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:gi._glib.IOChannel.readline", kwlist,
&size_hint))
return NULL;
@@ -579,7 +579,7 @@ py_io_channel_read_lines(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
GIOStatus status = G_IO_STATUS_NORMAL;
PyObject *list;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:glib.IOChannel.readlines", kwlist,
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:gi._glib.IOChannel.readlines", kwlist,
&size_hint))
return NULL;
@@ -613,7 +613,7 @@ py_io_channel_seek(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
GSeekType seek_type;
GError* error = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "L|i:glib.IOChannel.seek",
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "L|i:gi._glib.IOChannel.seek",
kwlist, &offset, &whence))
return NULL;
@@ -714,7 +714,7 @@ py_io_channel_init(PyGIOChannel *self, PyObject *args, PyObject *kwargs)
#ifdef G_OS_WIN32
"I"
#endif
- ":glib.IOChannel.__init__",
+ ":gi._glib.IOChannel.__init__",
kwlist, &fd, &filename, &mode
#ifdef G_OS_WIN32
, &hwnd
diff --git a/gi/_glib/pygmaincontext.c b/gi/_glib/pygmaincontext.c
index cfb7ddd..a4282ee 100644
--- a/gi/_glib/pygmaincontext.c
+++ b/gi/_glib/pygmaincontext.c
@@ -31,7 +31,7 @@
#include "pyglib.h"
#include "pyglib-private.h"
-PYGLIB_DEFINE_TYPE("glib.MainContext", PyGMainContext_Type, PyGMainContext)
+PYGLIB_DEFINE_TYPE("gi._glib.MainContext", PyGMainContext_Type, PyGMainContext)
/**
* pyg_main_context_new:
diff --git a/gi/_glib/pygmainloop.c b/gi/_glib/pygmainloop.c
index 219b6a3..614a662 100644
--- a/gi/_glib/pygmainloop.c
+++ b/gi/_glib/pygmainloop.c
@@ -233,7 +233,7 @@ pyg_signal_watch_new(void)
return source;
}
-PYGLIB_DEFINE_TYPE("glib.MainLoop", PyGMainLoop_Type, PyGMainLoop)
+PYGLIB_DEFINE_TYPE("gi._glib.MainLoop", PyGMainLoop_Type, PyGMainLoop)
static int
pyg_main_loop_init(PyGMainLoop *self, PyObject *args, PyObject *kwargs)
@@ -251,7 +251,7 @@ pyg_main_loop_init(PyGMainLoop *self, PyObject *args, PyObject *kwargs)
if (!PyObject_TypeCheck(py_context, &PyGMainContext_Type) &&
py_context != Py_None) {
PyErr_SetString(PyExc_TypeError,
- "context must be a glib.MainContext or None");
+ "context must be a gi._glib.MainContext or None");
return -1;
}
diff --git a/gi/_glib/pygoptioncontext.c b/gi/_glib/pygoptioncontext.c
index 444625c..b985dbe 100644
--- a/gi/_glib/pygoptioncontext.c
+++ b/gi/_glib/pygoptioncontext.c
@@ -28,7 +28,7 @@
#include "pyglib-private.h"
#include "pygoptioncontext.h"
-PYGLIB_DEFINE_TYPE("glib.OptionContext", PyGOptionContext_Type, PyGOptionContext)
+PYGLIB_DEFINE_TYPE("gi._glib.OptionContext", PyGOptionContext_Type, PyGOptionContext)
/**
* pyg_option_context_new:
@@ -58,7 +58,7 @@ pyg_option_context_init(PyGOptionContext *self,
{
char *parameter_string;
- if (!PyArg_ParseTuple(args, "s:glib.GOptionContext.__init__",
+ if (!PyArg_ParseTuple(args, "s:gi._glib.GOptionContext.__init__",
¶meter_string))
return -1;
diff --git a/gi/_glib/pygoptiongroup.c b/gi/_glib/pygoptiongroup.c
index 2a69354..2990342 100644
--- a/gi/_glib/pygoptiongroup.c
+++ b/gi/_glib/pygoptiongroup.c
@@ -28,7 +28,7 @@
#include "pyglib-private.h"
#include "pygoptiongroup.h"
-PYGLIB_DEFINE_TYPE("glib.OptionGroup", PyGOptionGroup_Type, PyGOptionGroup)
+PYGLIB_DEFINE_TYPE("gi._glib.OptionGroup", PyGOptionGroup_Type, PyGOptionGroup)
/**
* pyg_option_group_new:
@@ -62,7 +62,7 @@ check_if_owned(PyGOptionGroup *self)
if (self->other_owner)
{
PyErr_SetString(PyExc_ValueError, "The GOptionGroup was not created by "
- "glib.OptionGroup(), so operation is not possible.");
+ "gi._glib.OptionGroup(), so operation is not possible.");
return TRUE;
}
return FALSE;
diff --git a/gi/_glib/pygsource.c b/gi/_glib/pygsource.c
index d0176ab..60fb6d6 100644
--- a/gi/_glib/pygsource.c
+++ b/gi/_glib/pygsource.c
@@ -59,7 +59,7 @@ typedef struct
/* glib.Source */
-PYGLIB_DEFINE_TYPE("glib.Source", PyGSource_Type, PyGSource)
+PYGLIB_DEFINE_TYPE("gi._glib.Source", PyGSource_Type, PyGSource)
static PyObject *
source_repr(PyGSource *self, const char *type)
@@ -566,7 +566,7 @@ pyg_source_free(PyObject *op)
/* glib.Idle */
-PYGLIB_DEFINE_TYPE("glib.Idle", PyGIdle_Type, PyGSource)
+PYGLIB_DEFINE_TYPE("gi._glib.Idle", PyGIdle_Type, PyGSource)
static PyObject *
pyg_idle_repr(PyGSource *self)
@@ -581,7 +581,7 @@ pyg_idle_init(PyGSource *self, PyObject *args, PyObject *kwargs)
gint priority = G_PRIORITY_DEFAULT_IDLE;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "|i:glib.Idle.__init__", kwlist,
+ "|i:gi._glib.Idle.__init__", kwlist,
&priority))
return -1;
@@ -600,7 +600,7 @@ pyg_idle_init(PyGSource *self, PyObject *args, PyObject *kwargs)
/* glib.Timeout */
-PYGLIB_DEFINE_TYPE("glib.Timeout", PyGTimeout_Type, PyGSource)
+PYGLIB_DEFINE_TYPE("gi._glib.Timeout", PyGTimeout_Type, PyGSource)
static PyObject *
pyg_timeout_repr(PyGSource *self)
@@ -616,7 +616,7 @@ pyg_timeout_init(PyGSource *self, PyObject *args, PyObject *kwargs)
guint interval;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "I|i:glib.Timeout.__init__", kwlist,
+ "I|i:gi._glib.Timeout.__init__", kwlist,
&interval, &priority))
return -1;
@@ -635,7 +635,7 @@ pyg_timeout_init(PyGSource *self, PyObject *args, PyObject *kwargs)
/* glib.PollFD */
-PYGLIB_DEFINE_TYPE("glib.PollFD", PyGPollFD_Type, PyGPollFD)
+PYGLIB_DEFINE_TYPE("gi._glib.PollFD", PyGPollFD_Type, PyGPollFD)
static PyMemberDef pyg_poll_fd_members[] = {
{ "fd", T_INT, offsetof(PyGPollFD, pollfd.fd), READONLY },
@@ -668,7 +668,7 @@ pyg_poll_fd_init(PyGPollFD *self, PyObject *args, PyObject *kwargs)
gushort events;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
- "OH:glib.PollFD.__init__", kwlist,
+ "OH:gi._glib.PollFD.__init__", kwlist,
&o, &events))
return -1;
diff --git a/gi/_glib/pygspawn.c b/gi/_glib/pygspawn.c
index 75e2232..309b83d 100644
--- a/gi/_glib/pygspawn.c
+++ b/gi/_glib/pygspawn.c
@@ -32,7 +32,7 @@ struct _PyGChildSetupData {
PyObject *data;
};
-PYGLIB_DEFINE_TYPE("glib.Pid", PyGPid_Type, PYGLIB_PyLongObject)
+PYGLIB_DEFINE_TYPE("gi._glib.Pid", PyGPid_Type, PYGLIB_PyLongObject)
static PyObject *
pyg_pid_close(PyObject *self, PyObject *args, PyObject *kwargs)
@@ -57,7 +57,7 @@ pyg_pid_free(PyObject *gpid)
static int
pyg_pid_tp_init(PyObject *self, PyObject *args, PyObject *kwargs)
{
- PyErr_SetString(PyExc_TypeError, "glib.Pid cannot be manually instantiated");
+ PyErr_SetString(PyExc_TypeError, "gi._glib.Pid cannot be manually instantiated");
return -1;
}
@@ -117,7 +117,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs)
GPid child_pid = -1;
Py_ssize_t len, i;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|OsiOOOOO:glib.spawn_async",
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|OsiOOOOO:gi._glib.spawn_async",
kwlist,
&pyargv, &pyenvp, &working_directory, &flags,
&func, &user_data,
@@ -142,7 +142,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs)
/* parse argv */
if (!PySequence_Check(pyargv)) {
PyErr_SetString(PyExc_TypeError,
- "glib.spawn_async: "
+ "gi._glib.spawn_async: "
"first argument must be a sequence of strings");
return NULL;
}
@@ -152,7 +152,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs)
PyObject *tmp = PySequence_ITEM(pyargv, i);
if (!PYGLIB_PyUnicode_Check(tmp)) {
PyErr_SetString(PyExc_TypeError,
- "glib.spawn_async: "
+ "gi._glib.spawn_async: "
"first argument must be a sequence of strings");
g_free(argv);
Py_XDECREF(tmp);
@@ -166,7 +166,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs)
if (pyenvp) {
if (!PySequence_Check(pyenvp)) {
PyErr_SetString(PyExc_TypeError,
- "glib.spawn_async: "
+ "gi._glib.spawn_async: "
"second argument must be a sequence of strings");
g_free(argv);
return NULL;
@@ -177,7 +177,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs)
PyObject *tmp = PySequence_ITEM(pyenvp, i);
if (!PYGLIB_PyUnicode_Check(tmp)) {
PyErr_SetString(PyExc_TypeError,
- "glib.spawn_async: "
+ "gi._glib.spawn_async: "
"second argument must be a sequence of strings");
g_free(envp);
Py_XDECREF(tmp);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]