pygobject r873 - in trunk: . glib



Author: johan
Date: Sat Jul 26 13:48:46 2008
New Revision: 873
URL: http://svn.gnome.org/viewvc/pygobject?rev=873&view=rev

Log:
2008-07-26  Johan Dahlin  <johan gnome org>

    * glib/pygiochannel.c (py_io_channel_shutdown),
    (py_io_channel_set_buffer_size), (py_io_channel_get_buffer_size),
    (py_io_channel_set_buffered), (py_io_channel_get_buffered),
    (py_io_channel_set_encoding), (py_io_channel_get_encoding),
    (py_io_channel_read_chars), (py_io_channel_write_chars),
    (py_io_channel_write_lines), (py_io_channel_flush),
    (py_io_channel_set_flags), (py_io_channel_get_flags),
    (py_io_channel_get_buffer_condition),
    (py_io_channel_set_close_on_unref), (py_io_channel_add_watch),
    (py_io_channel_win32_poll), (py_io_channel_win32_make_pollfd),
    (py_io_channel_read_line), (py_io_channel_read_lines),
    (py_io_channel_seek), (py_io_channel_init):
    * glib/pyglib.c (pyglib_gerror_exception_check):
    * glib/pygoptioncontext.c (pyg_option_context_init):
    * glib/pygoptiongroup.c (check_if_owned):
    * glib/pygsource.c (pyg_idle_init), (pyg_timeout_init),
    (pyg_poll_fd_init):
    gobject -> glib



Modified:
   trunk/ChangeLog
   trunk/glib/pygiochannel.c
   trunk/glib/pyglib.c
   trunk/glib/pygoptioncontext.c
   trunk/glib/pygoptiongroup.c
   trunk/glib/pygsource.c

Modified: trunk/glib/pygiochannel.c
==============================================================================
--- trunk/glib/pygiochannel.c	(original)
+++ trunk/glib/pygiochannel.c	Sat Jul 26 13:48:46 2008
@@ -17,7 +17,7 @@
     int softspace;         /* to make print >> chan, "foo" ... work */
 } PyGIOChannel;
 
-PYGLIB_DEFINE_TYPE("gobject.IOChannel", PyGIOChannel_Type, PyGIOChannel)
+PYGLIB_DEFINE_TYPE("glib.IOChannel", PyGIOChannel_Type, PyGIOChannel)
 
 static PyObject*
 py_io_channel_next(PyGIOChannel *self)
@@ -80,7 +80,7 @@
     PyObject* flush = Py_True;
     GError* error = NULL;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:gobject.IOChannel.shutdown", kwlist, &flush))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:glib.IOChannel.shutdown", kwlist, &flush))
         return NULL;
 	
     ret = g_io_channel_shutdown(self->channel, PyObject_IsTrue(flush), &error);
@@ -99,7 +99,7 @@
     static char *kwlist[] = { "size", NULL };
     int size;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:gobject.IOChannel.set_buffer_size", kwlist, &size))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:glib.IOChannel.set_buffer_size", kwlist, &size))
         return NULL;
 	
     g_io_channel_set_buffer_size(self->channel, size);
@@ -114,7 +114,7 @@
     static char *kwlist[] = { NULL };
     int size;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:gobject.IOChannel.get_buffer_size", kwlist))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:glib.IOChannel.get_buffer_size", kwlist))
         return NULL;
 	
     size = g_io_channel_get_buffer_size(self->channel);
@@ -128,7 +128,7 @@
     static char *kwlist[] = { "buffered", NULL };
     int buffered;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:gobject.IOChannel.set_buffered", kwlist, &buffered))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:glib.IOChannel.set_buffered", kwlist, &buffered))
         return NULL;
 	
     g_io_channel_set_buffered(self->channel, buffered);
@@ -143,7 +143,7 @@
     static char *kwlist[] = { NULL };
     int buffered;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":gobject.IOChannel.get_buffered", kwlist))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":glib.IOChannel.get_buffered", kwlist))
         return NULL;
 	
     buffered = g_io_channel_get_buffered(self->channel);
@@ -158,7 +158,7 @@
     const char* encoding;
     GError* error = NULL;
     
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z:gobject.IOChannel.set_encoding", kwlist, &encoding))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z:glib.IOChannel.set_encoding", kwlist, &encoding))
         return NULL;
     
     g_io_channel_set_encoding(self->channel, encoding, &error);
@@ -175,7 +175,7 @@
     static char *kwlist[] = { NULL };
     const char* encoding;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":gobject.IOChannel.get_encoding", kwlist))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":glib.IOChannel.get_encoding", kwlist))
         return NULL;
 	
     encoding = g_io_channel_get_encoding(self->channel);
@@ -200,7 +200,7 @@
     GError* error = NULL;
     GIOStatus status = G_IO_STATUS_NORMAL;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:gobject.IOChannel.read", kwlist, &max_count))
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:glib.IOChannel.read", kwlist, &max_count))
         return NULL;
 	
     if (max_count == 0)
@@ -263,7 +263,7 @@
     GError* error = NULL;
     GIOStatus status;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#:gobject.IOChannel.write",
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#:glib.IOChannel.write",
                                      kwlist, &buf, &buf_len))
         return NULL;
 	
@@ -287,7 +287,7 @@
     GIOStatus status;
     PyObject *iter, *value, *pylines;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gobject.IOChannel.writelines",
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:glib.IOChannel.writelines",
                                      kwlist, &pylines))
         return NULL;
 
@@ -300,7 +300,7 @@
             goto normal_exit;
         }
         if (!_PyUnicode_Check(value)) {
-            PyErr_SetString(PyExc_TypeError, "gobject.IOChannel.writelines must"
+            PyErr_SetString(PyExc_TypeError, "glib.IOChannel.writelines must"
                             " be sequence/iterator of strings");
             Py_DECREF(iter);
             return NULL;
@@ -328,7 +328,7 @@
     GError* error = NULL;
     GIOStatus status;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":gobject.IOChannel.flush",
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":glib.IOChannel.flush",
                                      kwlist))
         return NULL;
 	
@@ -349,7 +349,7 @@
     GIOStatus status;
     GError* error = NULL;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:gobject.IOChannel.set_flags",
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:glib.IOChannel.set_flags",
                                      kwlist, &flags))
         return NULL;
 	
@@ -366,7 +366,7 @@
     static char *kwlist[] = { NULL };
     GIOFlags flags;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":gobject.IOChannel.get_flags",
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":glib.IOChannel.get_flags",
                                      kwlist))
         return NULL;
 	
@@ -380,7 +380,7 @@
     static char *kwlist[] = { NULL };
     GIOCondition cond;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":gobject.IOChannel.get_buffer_condition",
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":glib.IOChannel.get_buffer_condition",
                                      kwlist))
         return NULL;
 	
@@ -394,7 +394,7 @@
     static char *kwlist[] = { "do_close", NULL };
     PyObject *do_close;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gobject.IOChannel.set_close_on_unref",
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:glib.IOChannel.set_close_on_unref",
                                      kwlist, &do_close))
         return NULL;
 	
@@ -478,7 +478,7 @@
     PyGIOWatchData *data;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-                                     "iO|Oi:gobject.IOChannel.add_watch",
+                                     "iO|Oi:glib.IOChannel.add_watch",
                                      kwlist, &condition, &callback,
                                      &user_data, &priority))
         return NULL;
@@ -516,7 +516,7 @@
     gint result;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-                                     "O!|i:gobject.IOChannel.win32_poll",
+                                     "O!|i:glib.IOChannel.win32_poll",
                                      kwlist, &PyList_Type, &pyfds, &timeout))
         return NULL;
 
@@ -525,7 +525,7 @@
     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 gobject.PollFD objects");
+            PyErr_SetString(PyExc_TypeError, "'fds' must be a list of glib.PollFD objects");
             return NULL;
         }
         pollfd[i] = ((PyGPollFD *) pyfd)->pollfd;
@@ -548,7 +548,7 @@
     PyGPollFD *pypollfd;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-                                     "i:gobject.IOChannel.win32_make_pollfd",
+                                     "i:glib.IOChannel.win32_make_pollfd",
                                      kwlist, &condition))
         return NULL;
 
@@ -572,7 +572,7 @@
     gint size_hint = -1;
     GIOStatus status;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:gobject.IOChannel.readline", kwlist,
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:glib.IOChannel.readline", kwlist,
                                      &size_hint))
         return NULL;
 
@@ -597,7 +597,7 @@
     GIOStatus status = G_IO_STATUS_NORMAL;
     PyObject *list;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:gobject.IOChannel.readlines", kwlist,
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:glib.IOChannel.readlines", kwlist,
                                      &size_hint))
         return NULL;
 
@@ -631,7 +631,7 @@
     GSeekType seek_type;
     GError* error = NULL;
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "L|i:gobject.IOChannel.seek",
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "L|i:glib.IOChannel.seek",
                                      kwlist, &offset, &whence))
         return NULL;
 
@@ -732,7 +732,7 @@
 #ifdef G_OS_WIN32
                                      "I"
 #endif
-                                     ":gobject.IOChannel.__init__",
+                                     ":glib.IOChannel.__init__",
                                      kwlist, &fd, &filename, &mode
 #ifdef G_OS_WIN32
                                      , &hwnd

Modified: trunk/glib/pyglib.c
==============================================================================
--- trunk/glib/pyglib.c	(original)
+++ trunk/glib/pyglib.c	Sat Jul 26 13:48:46 2008
@@ -272,7 +272,7 @@
  * raised exception is not a GError then PyErr_Print() is called.
  *
  * Returns: 0 if no exception has been raised, -1 if it is a
- * valid gobject.GError, -2 otherwise.
+ * valid glib.GError, -2 otherwise.
  */
 gboolean
 pyglib_gerror_exception_check(GError **error)
@@ -302,20 +302,20 @@
 
     py_message = PyObject_GetAttrString(value, "message");
     if (!py_message || !_PyUnicode_Check(py_message)) {
-        bad_gerror_message = "gobject.GError instances must have a 'message' string attribute";
+        bad_gerror_message = "glib.GError instances must have a 'message' string attribute";
         goto bad_gerror;
     }
 
     py_domain = PyObject_GetAttrString(value, "domain");
     if (!py_domain || !_PyUnicode_Check(py_domain)) {
-        bad_gerror_message = "gobject.GError instances must have a 'domain' string attribute";
+        bad_gerror_message = "glib.GError instances must have a 'domain' string attribute";
         Py_DECREF(py_message);
         goto bad_gerror;
     }
 
     py_code = PyObject_GetAttrString(value, "code");
     if (!py_code || !_PyLong_Check(py_code)) {
-        bad_gerror_message = "gobject.GError instances must have a 'code' int attribute";
+        bad_gerror_message = "glib.GError instances must have a 'code' int attribute";
         Py_DECREF(py_message);
         Py_DECREF(py_domain);
         goto bad_gerror;
@@ -331,7 +331,7 @@
 
 bad_gerror:
     Py_DECREF(value);
-    g_set_error(error, g_quark_from_static_string("pygobject"), 0, bad_gerror_message);
+    g_set_error(error, g_quark_from_static_string("pyglib"), 0, bad_gerror_message);
     PyErr_SetString(PyExc_ValueError, bad_gerror_message);
     PyErr_Print();
     return -2;

Modified: trunk/glib/pygoptioncontext.c
==============================================================================
--- trunk/glib/pygoptioncontext.c	(original)
+++ trunk/glib/pygoptioncontext.c	Sat Jul 26 13:48:46 2008
@@ -36,7 +36,7 @@
                         PyObject *kwargs)
 {
     char *parameter_string;
-    if (!PyArg_ParseTuple(args, "s:gobject.GOptionContext.__init__",
+    if (!PyArg_ParseTuple(args, "s:glib.GOptionContext.__init__",
                           &parameter_string))
         return -1;
     

Modified: trunk/glib/pygoptiongroup.c
==============================================================================
--- trunk/glib/pygoptiongroup.c	(original)
+++ trunk/glib/pygoptiongroup.c	Sat Jul 26 13:48:46 2008
@@ -36,7 +36,7 @@
     if (self->other_owner)
     {
         PyErr_SetString(PyExc_ValueError, "The GOptionGroup was not created by "
-                        "gobject.OptionGroup(), so operation is not possible.");
+                        "glib.OptionGroup(), so operation is not possible.");
         return TRUE;
     }
     return FALSE;

Modified: trunk/glib/pygsource.c
==============================================================================
--- trunk/glib/pygsource.c	(original)
+++ trunk/glib/pygsource.c	Sat Jul 26 13:48:46 2008
@@ -57,9 +57,9 @@
     PyObject *obj;
 } PyGRealSource;
 
-/* gobject.GSource */
+/* glib.GSource */
 
-PYGLIB_DEFINE_TYPE("gobject.Source", PyGSource_Type, PyGSource)
+PYGLIB_DEFINE_TYPE("glib.Source", PyGSource_Type, PyGSource)
 
 static PyObject *
 source_repr(PyGSource *self, const char *type)
@@ -562,9 +562,9 @@
     PyObject_GC_Del(op);
 }
 
-/* gobject.Idle */
+/* glib.Idle */
 
-PYGLIB_DEFINE_TYPE("gobject.Idle", PyGIdle_Type, PyGSource)
+PYGLIB_DEFINE_TYPE("glib.Idle", PyGIdle_Type, PyGSource)
 
 static PyObject *
 pyg_idle_repr(PyGSource *self)
@@ -579,7 +579,7 @@
     gint priority = G_PRIORITY_DEFAULT_IDLE;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-				     "|i:gobject.Idle.__init__", kwlist,
+				     "|i:glib.Idle.__init__", kwlist,
 				     &priority))
 	return -1;
 
@@ -596,9 +596,9 @@
     return 0;
 }
 
-/* gobject.Timeout */
+/* glib.Timeout */
 
-PYGLIB_DEFINE_TYPE("gobject.Timeout", PyGTimeout_Type, PyGSource)
+PYGLIB_DEFINE_TYPE("glib.Timeout", PyGTimeout_Type, PyGSource)
 
 static PyObject *
 pyg_timeout_repr(PyGSource *self)
@@ -614,7 +614,7 @@
     guint interval;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-				     "I|i:gobject.Timeout.__init__", kwlist,
+				     "I|i:glib.Timeout.__init__", kwlist,
 				     &interval, &priority))
 	return -1;
 
@@ -631,9 +631,9 @@
     return 0;
 }
 
-/* gobject.PollFD */
+/* glib.PollFD */
 
-PYGLIB_DEFINE_TYPE("gobject.PollFD", PyGPollFD_Type, PyGPollFD)
+PYGLIB_DEFINE_TYPE("glib.PollFD", PyGPollFD_Type, PyGPollFD)
 
 static PyMemberDef pyg_poll_fd_members[] = {
     { "fd",      T_INT,    offsetof(PyGPollFD, pollfd.fd),      RO },
@@ -666,7 +666,7 @@
     gushort events;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-				     "OH:gobject.PollFD.__init__", kwlist,
+				     "OH:glib.PollFD.__init__", kwlist,
 				     &o, &events))
 	return -1;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]