--- pygobject/examples/Makefile.am	2006-04-14 22:56:27.000000000 +0200
+++ gnome-python/pygobject/examples/Makefile.am	2006-01-09 13:26:45.000000000 +0100
@@ -1,2 +1 @@
-EXTRA_DIST = properties.py signal.py option.py
-
+EXTRA_DIST = properties.py signal.py
--- pygobject/gobject/Makefile.am	2006-04-15 21:08:42.000000000 +0200
+++ gnome-python/pygobject/gobject/Makefile.am	2006-04-15 18:29:32.000000000 +0200
@@ -9,7 +9,7 @@ pkgpyexecdir = $(pyexecdir)/gtk-2.0
 
 # gobject python scripts
 pygobjectdir = $(pkgpyexecdir)/gobject
-pygobject_PYTHON = __init__.py option.py
+pygobject_PYTHON = __init__.py
 pygobject_LTLIBRARIES = _gobject.la 
 
 
@@ -36,9 +36,7 @@ _gobject_la_SOURCES = \
 	pygpointer.c \
 	pygiochannel.c \
 	pygsource.c \
-	pygtype.c \
-	pygoptioncontext.c \
-	pygoptiongroup.c
+	pygtype.c
 
 if PLATFORM_WIN32
 _gobject_la_CFLAGS += -DPLATFORM_WIN32
--- pygobject/gobject/gobjectmodule.c	2006-04-15 21:00:41.000000000 +0200
+++ gnome-python/pygobject/gobject/gobjectmodule.c	2006-04-12 00:58:37.000000000 +0200
@@ -3101,9 +3101,6 @@ init_gobject(void)
     REGISTER_TYPE(d, PyGTimeout_Type, "Timeout");
     REGISTER_TYPE(d, PyGPollFD_Type, "PollFD");
 
-    REGISTER_TYPE(d, PyGOptionContext_Type, "OptionContext");
-    REGISTER_TYPE(d, PyGOptionGroup_Type, "OptionGroup");
-
     /* glib version */
     tuple = Py_BuildValue ("(iii)", glib_major_version, glib_minor_version,
 			   glib_micro_version);
@@ -3170,21 +3167,7 @@ init_gobject(void)
     addint(IO_FLAG_GET_MASK);
     addint(IO_FLAG_SET_MASK);
 
-    addint(OPTION_FLAG_HIDDEN);
-    addint(OPTION_FLAG_IN_MAIN);
-    addint(OPTION_FLAG_REVERSE);
-    addint(OPTION_FLAG_NO_ARG);
-    addint(OPTION_FLAG_FILENAME);
-    addint(OPTION_FLAG_OPTIONAL_ARG);
-    addint(OPTION_FLAG_NOALIAS);
- 
-    addint(OPTION_ERROR_UNKNOWN_OPTION);
-    addint(OPTION_ERROR_BAD_VALUE);
-    addint(OPTION_ERROR_FAILED);
- 
 #undef addint
-  
-    PyModule_AddStringConstant(m, "OPTION_REMAINING", G_OPTION_REMAINING);
 
     PyModule_AddIntConstant(m, "SPAWN_LEAVE_DESCRIPTORS_OPEN",
 			    G_SPAWN_LEAVE_DESCRIPTORS_OPEN);
--- pygobject/gobject/pygobject-private.h	2006-04-15 17:11:42.000000000 +0200
+++ gnome-python/pygobject/gobject/pygobject-private.h	2006-04-11 23:51:06.000000000 +0200
@@ -217,28 +217,4 @@ typedef struct
 } PyGPollFD;
 
 
-/* pygoption.c */
-extern PyTypeObject PyGOptionContext_Type;
-extern PyTypeObject PyGOptionGroup_Type;
-
-typedef struct {
-    PyObject_HEAD
-    GOptionGroup *group;
-    gboolean other_owner, is_in_context;
-    PyObject *callback,
-             *pre_hook, *post_hook, *hooks_arg,
-             *error_hook, *error_hook_arg,
-             *translate_func, *translate_func_arg;
-} PyGOptionGroup;
-
-typedef struct {
-    PyObject_HEAD
-    PyGOptionGroup *main_group;
-    GOptionContext *context;
-} PyGOptionContext;
-
-PyObject * pyg_option_context_new (GOptionContext * context);
-PyObject * pyg_option_group_new (GOptionGroup * group);
-GOptionGroup *pyg_option_group_transfer_group(PyGOptionGroup *self);
-
 #endif
--- pygobject/gobject/pygoptioncontext.c	2006-04-15 21:36:07.000000000 +0200
+++ gnome-python/pygobject/gobject/pygoptioncontext.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,279 +0,0 @@
-/* -*- Mode: C; c-basic-offset: 4 -*-
- * pygtk- Python bindings for the GTK toolkit.
- * Copyright (C) 2006  Johannes Hoelzl
- *
- *   pygoptioncontext.c: GOptionContext wrapper
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include "pygobject-private.h"
-
-static int
-pyg_option_context_init(PyGOptionContext *self, 
-                        PyObject *args,
-                        PyObject *kwargs)
-{
-    char *parameter_string;
-    if (! PyArg_ParseTuple(args, "s:gobject.GOptionContext.__init__", &parameter_string))
-        return -1;
-    
-    self->context = g_option_context_new(parameter_string);
-    return 0;
-}
-
-static void
-pyg_option_context_dealloc(PyGOptionContext *self)
-{
-    Py_CLEAR(self->main_group);
-    
-    if(self->context != NULL)
-    {
-        GOptionContext *tmp = self->context;
-        self->context = NULL;
-        g_option_context_free(tmp);
-    }
-
-    PyObject_Del(self);
-}
-
-static PyObject *
-pyg_option_context_parse(PyGOptionContext *self, PyObject *argv)
-{
-    PyObject *arg;
-    PyObject *new_argv;
-    gssize argv_length, pos;
-    char **argv_content, **original;
-    GError *error = NULL;
-    gboolean result;
-    
-    argv_length = PySequence_Size(argv);
-    if(argv_length == -1)
-    {
-        PyErr_SetString(PyExc_TypeError, 
-                        "GOptionContext.parse expects a list of strings.");
-        return NULL;
-    }
-    
-    argv_content = g_new(char*, PySequence_Size(argv) + 1);
-    argv_content[argv_length] = NULL;
-    for(pos = 0; pos < argv_length; pos++)
-    {
-        arg = PySequence_GetItem(argv, pos);
-        argv_content[pos] = g_strdup(PyString_AsString(arg));
-        if(argv_content[pos] == NULL)
-        {
-            g_strfreev(argv_content);
-            return NULL;
-        }
-    }
-    original = g_memdup(argv_content, sizeof(char*) * (PySequence_Size(argv) + 1));
-    
-    pyg_begin_allow_threads;
-    result = g_option_context_parse(self->context, &argv_length, &argv_content, &error);
-    pyg_end_allow_threads;
-
-    if(! result)
-    {
-        g_free(argv_content);
-        g_strfreev(original);
-        pyg_error_check(&error);
-        return NULL;
-    }
-    
-    new_argv = PyList_New(0);
-    for(pos = 0; pos < argv_length; pos++)
-    {
-        arg = PyString_FromString(argv_content[pos]);
-        PyList_Append(new_argv, arg);
-    }
-    
-    g_strfreev(original);
-    g_free(argv_content);
-    return new_argv;
-}
-
-static PyObject *
-pyg_option_context_set_help_enabled(PyGOptionContext *self,
-                                    PyObject *enabled)
-{
-    g_option_context_set_help_enabled(self->context, PyObject_IsTrue(enabled));
-    Py_RETURN_NONE;
-}
-
-static PyObject *
-pyg_option_context_get_help_enabled(PyGOptionContext *self)
-{
-    return PyBool_FromLong(g_option_context_get_help_enabled(self->context));
-}
-
-static PyObject *
-pyg_option_context_set_ignore_unknown_options(PyGOptionContext *self,
-                                              PyObject *ignore)
-{
-    g_option_context_set_ignore_unknown_options(self->context, 
-                                                PyObject_IsTrue(ignore));
-    Py_RETURN_NONE;
-}
-
-static PyObject *
-pyg_option_context_get_ignore_unknown_options(PyGOptionContext *self)
-{
-    return PyBool_FromLong(
-        g_option_context_get_ignore_unknown_options(self->context));
-}
-
-static PyObject *
-pyg_option_context_set_main_group(PyGOptionContext *self,
-                                  PyObject *group)
-{
-    GOptionGroup* g_group;
-    if(PyObject_IsInstance(group, (PyObject*) &PyGOptionGroup_Type) != 1) {
-        PyErr_SetString(PyExc_TypeError, "GOptionContext.set_main_group expects a GOptionGroup.");
-        return NULL;
-    }
-    g_group = pyg_option_group_transfer_group((PyGOptionGroup*) group);
-    if(g_group == NULL)
-    {
-        PyErr_SetString(PyExc_RuntimeError, "Group is already in a OptionContext.");
-        return NULL;
-    }
-
-    g_option_context_set_main_group(self->context, g_group);
-    Py_INCREF(group);
-    self->main_group = (PyGOptionGroup*) group;
-    
-    Py_RETURN_NONE;
-}
-
-static PyObject *
-pyg_option_context_get_main_group(PyGOptionContext *self)
-{
-    if(self->main_group == NULL)
-        Py_RETURN_NONE;
-        
-    Py_INCREF(self->main_group);
-    return (PyObject*) self->main_group;
-}
-
-static PyObject *
-pyg_option_context_add_group(PyGOptionContext *self,
-                             PyObject *group)
-{
-    GOptionGroup* g_group;
-    if(PyObject_IsInstance(group, (PyObject*) &PyGOptionGroup_Type) != 1) {
-        PyErr_SetString(PyExc_TypeError, "GOptionContext.add_group expects a GOptionGroup.");
-        return NULL;
-    }
-    g_group = pyg_option_group_transfer_group((PyGOptionGroup*) group);
-    if(g_group == NULL)
-    {
-        PyErr_SetString(PyExc_RuntimeError, "Group is already in a OptionContext.");
-        return NULL;
-    }
-    g_option_context_add_group(self->context, g_group);
-    Py_INCREF(group);
-    
-    Py_RETURN_NONE;
-} 
-
-static int
-pyg_option_context_compare(PyGOptionContext *self, PyGOptionContext *context)
-{
-    if(self->context == context->context) return 0;
-    if(self->context > context->context)
-        return 1;
-    return -1;
-}
-
-static PyMethodDef pyg_option_context_methods[] = {
-    { "parse", (PyCFunction)pyg_option_context_parse, METH_O },
-    { "set_help_enabled", (PyCFunction)pyg_option_context_set_help_enabled, METH_O },
-    { "get_help_enabled", (PyCFunction)pyg_option_context_get_help_enabled, METH_NOARGS },
-    { "set_ignore_unknown_options", (PyCFunction)pyg_option_context_set_ignore_unknown_options, METH_O },
-    { "get_ignore_unknown_options", (PyCFunction)pyg_option_context_get_ignore_unknown_options, METH_NOARGS },
-    { "set_main_group", (PyCFunction)pyg_option_context_set_main_group, METH_O },
-    { "get_main_group", (PyCFunction)pyg_option_context_get_main_group, METH_NOARGS },
-    { "add_group", (PyCFunction)pyg_option_context_add_group, METH_O },
-    { NULL, NULL, 0 },
-};
-
-PyTypeObject PyGOptionContext_Type = {
-    PyObject_HEAD_INIT(NULL)
-    0,
-    "gobject.OptionContext",
-    sizeof(PyGMainContext),
-    0,
-    /* methods */
-    (destructor)pyg_option_context_dealloc,
-    (printfunc)0,
-    (getattrfunc)0,
-    (setattrfunc)0,
-    (cmpfunc)pyg_option_context_compare,
-    (reprfunc)0,
-    0,
-    0,
-    0,
-    (hashfunc)0,
-    (ternaryfunc)0,
-    (reprfunc)0,
-    (getattrofunc)0,
-    (setattrofunc)0,
-    0,
-    Py_TPFLAGS_DEFAULT,
-    NULL,
-    (traverseproc)0,
-    (inquiry)0,
-    (richcmpfunc)0,
-    0,
-    (getiterfunc)0,
-    (iternextfunc)0,
-    pyg_option_context_methods,
-    0,
-    0,
-    NULL,
-    NULL,
-    (descrgetfunc)0,
-    (descrsetfunc)0,
-    0,
-    (initproc)pyg_option_context_init,
-};
-
-/**
- * pyg_option_context_new:
- * @context: a GOptionContext
- *
- * Returns: A new GOptionContext wrapper.
- */
-PyObject * 
-pyg_option_context_new (GOptionContext *context)
-{
-    PyGOptionContext *self;
-
-    self = (PyGOptionContext *)PyObject_NEW(PyGOptionContext,
-					    &PyGOptionContext_Type);
-    if (self == NULL)
-	return NULL;
-
-    self->context = context;
-    self->main_group = NULL;
-    
-    return (PyObject *)self;
-}
--- pygobject/gobject/pygoptiongroup.c	2006-04-15 22:09:44.000000000 +0200
+++ gnome-python/pygobject/gobject/pygoptiongroup.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,498 +0,0 @@
-/* -*- Mode: C; c-basic-offset: 4 -*-
- * pygtk- Python bindings for the GTK toolkit.
- * Copyright (C) 2006  Johannes Hoelzl
- *
- *   pygoptiongroup.c: GOptionContext and GOptionGroup wrapper
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include "pygobject-private.h"
-
-static gboolean
-check_if_owned(PyGOptionGroup *self)
-{
-    if(self->other_owner)
-    {
-        PyErr_SetString(PyExc_ValueError, "The GOptionGroup was not created by gobject.OptionGroup(), so operation is not possible.");
-        return TRUE;
-    }
-    return FALSE;
-}
-
-static gboolean
-call_parse_func(PyGOptionGroup *self,
-                GOptionContext *context,
-                PyObject *func,
-                PyObject *arg,
-                GError **error)
-{
-    PyObject *obj;
-    PyGILState_STATE state;
-   
-    if (func == NULL) return TRUE;
-
-    state = pyg_gil_state_ensure();
-  
-    if(arg != NULL)
-        obj = PyObject_CallFunction(func, "OO", self, arg);
-    else
-        obj = PyObject_CallFunction(func, "O", self);
-
-    if(obj == NULL)
-        PyErr_Print();
-
-    pyg_gil_state_release(state);
-
-    if(obj == NULL)
-        return FALSE;
-      
-    Py_DECREF(obj);
-    return TRUE;
-}
-
-static gboolean
-pre_hook(GOptionContext *context,
-         GOptionGroup *group,
-         PyGOptionGroup *pyg,
-         GError **error)
-{
-    return call_parse_func(pyg, context, pyg->pre_hook, pyg->hooks_arg, error);
-}
-
-static gboolean
-post_hook(GOptionContext *context,
-          GOptionGroup *group,
-          PyGOptionGroup *pyg,
-          GError **error)
-{
-    return call_parse_func(pyg, context, pyg->post_hook, pyg->hooks_arg, error);
-}
-
-static void
-error_hook(GOptionContext *context, 
-           GOptionGroup *group,
-           PyGOptionGroup *pyg,
-           GError **error)
-{
-    call_parse_func(pyg, context, pyg->error_hook, pyg->error_hook_arg, error);
-}
-
-static void destroy_g_group(PyGOptionGroup *self)
-{
-    GOptionGroup *group = self->group;
-    self->group = NULL;
-    if(group != NULL)
-    {
-        if(self->is_in_context)
-        {
-            Py_DECREF(self);
-        }
-        
-        Py_CLEAR(self->callback);
-        Py_CLEAR(self->pre_hook);
-        Py_CLEAR(self->post_hook);
-        Py_CLEAR(self->hooks_arg);
-        Py_CLEAR(self->error_hook);
-        Py_CLEAR(self->translate_func);
-        Py_CLEAR(self->translate_func_arg);
-    }
-}
-
-static int
-pyg_option_group_init(PyGOptionGroup *self, PyObject *args)
-{
-    char *name, *description, *help_description;
-    PyObject *callback;
-    
-    if (! PyArg_ParseTuple(args, "zzzO:GOptionGroup.__init__", 
-                           &name, &description, &help_description, &callback))
-        return -1;
-    
-    self->group = g_option_group_new(name, description, help_description,
-                                     self, (GDestroyNotify) destroy_g_group);
-    g_option_group_set_parse_hooks(self->group, 
-                                   (GOptionParseFunc) pre_hook,
-                                   (GOptionParseFunc) post_hook);
-    g_option_group_set_error_hook(self->group, (GOptionErrorFunc) error_hook);
-    self->other_owner = FALSE;
-    self->is_in_context = FALSE;
-    
-    self->callback = callback;
-    Py_INCREF(callback);
-    
-    return 0;
-}
-
-static void
-pyg_option_group_dealloc(PyGOptionGroup *self)
-{
-    if(! self->other_owner)
-    {
-        if(self->group != NULL)
-        {
-            GOptionGroup *tmp = self->group;
-            self->group = NULL;
-            g_option_group_free(tmp);
-        }
-    }
-
-    PyObject_Del(self);
-}
-
-static gboolean 
-arg_func(const gchar *option_name,
-         const gchar *value,
-         PyGOptionGroup *self,
-         GError *error)
-{
-    PyObject *obj;
-    PyGILState_STATE state;
-
-    state = pyg_gil_state_ensure();
-  
-    if(value != NULL) 
-        obj = PyObject_CallFunction(self->callback, "ssO", option_name, value, self);
-    else
-        obj = PyObject_CallFunction(self->callback, "sOO", option_name, Py_None, self);
-
-    if(obj == NULL)
-        PyErr_Print();
-
-    pyg_gil_state_release(state);
-
-    if(obj == NULL)
-        return FALSE;
-
-    Py_DECREF(obj);
-    return TRUE;      
-}
-
-static PyObject *
-pyg_option_group_add_entries(PyGOptionGroup *self, PyObject *sequence)
-{
-    gssize entry_count, pos;
-    PyObject *tuple;
-    GOptionEntry *entries;
-    
-    if(check_if_owned(self)) return NULL;
-    
-    entry_count = PySequence_Size(sequence);
-    if(entry_count == -1)
-    {
-        PyErr_SetString(PyExc_TypeError, "GOptionGroup.add_entries expected a list of entries");
-        return FALSE;
-    }
-    
-    entries = g_new0(GOptionEntry, entry_count + 1);
-    for(pos = 0; pos < entry_count; pos++)
-    {
-        tuple = PySequence_GetItem(sequence, pos);
-        if(! PyArg_ParseTuple(tuple, "scisz",
-            &(entries[pos].long_name),
-            &(entries[pos].short_name),
-            &(entries[pos].flags),
-            &(entries[pos].description),
-            &(entries[pos].arg_description)))
-        {
-            PyErr_SetString(PyExc_TypeError, "GOptionGroup.add_entries expected a list of entries");
-            g_free(entries);
-            return NULL;
-        }
-        entries[pos].arg = G_OPTION_ARG_CALLBACK;
-        entries[pos].arg_data = arg_func;
-    }
-    
-    g_option_group_add_entries(self->group, entries);
-    
-    g_free(entries);
-    
-    Py_RETURN_NONE;
-}
-
-
-static PyObject *
-pyg_option_group_set_parse_hooks(PyGOptionGroup *self, PyObject *args)
-{
-    PyObject *pre, *post, *arg = NULL;
-    if(check_if_owned(self)) return NULL;
-    
-    if(! PyArg_ParseTuple(args, "OO|O:GOptionGroup.set_parse_hooks", &pre, &post, &arg))
-        return NULL;
-    
-    if(! (PyCallable_Check(pre) || pre == Py_None) || 
-       ! (PyCallable_Check(post) || post == Py_None))
-    {
-        PyErr_SetString(PyExc_TypeError, "gobject.GOptionGroup.set_parse_hooks expects two callables.");
-        return NULL;
-    }
-    
-    Py_CLEAR(self->hooks_arg);
-    self->hooks_arg = arg;
-    Py_XINCREF(self->hooks_arg);
-
-    Py_CLEAR(self->pre_hook);
-    if(pre != Py_None)
-    {
-        self->pre_hook = pre;
-        Py_INCREF(self->pre_hook);
-    }
-
-    Py_CLEAR(self->post_hook);
-    if(post != Py_None)
-    {
-        self->post_hook = post;
-        Py_INCREF(self->post_hook);
-    }
-    
-    Py_RETURN_NONE;    
-}
-
-static PyObject *
-pyg_option_group_set_error_hook(PyGOptionGroup *self, PyObject *args)
-{
-    PyObject *error, *arg = NULL;
-    if(check_if_owned(self)) return NULL;
-
-    if(! PyArg_ParseTuple(args, "O|O:GOptionGroup.set_error_hook", &error, &arg))
-        return NULL;
-
-    if(! (PyCallable_Check(error) || error == Py_None))
-    {
-        PyErr_SetString(PyExc_TypeError, "gobject.GOptionGroup.set_error_hook expects a callable.");
-        return NULL;
-    }
-
-    Py_CLEAR(self->error_hook_arg);
-    self->error_hook_arg = arg;
-    Py_XINCREF(self->error_hook_arg);
-
-    Py_CLEAR(self->error_hook);
-    if(error == Py_None)
-    {
-        self->error_hook = error;
-        Py_INCREF(self->error_hook);
-    }
-
-    Py_RETURN_NONE;    
-}
-
-static gchar *
-translate_func(const gchar *str,
-               PyGOptionGroup *self)
-{
-    PyObject *obj;
-    gchar *result;
-    PyGILState_STATE state;
-
-    state = pyg_gil_state_ensure();
-   
-    if(self->translate_func_arg != NULL)
-        obj = PyObject_CallFunction(self->translate_func, "sOO", str, self, self->translate_func_arg);
-    else
-        obj = PyObject_CallFunction(self->translate_func, "sO", str, self);
-
-    if(obj == NULL)
-        PyErr_Print();
-
-    pyg_gil_state_release(state);
-
-    if(obj == NULL)
-        return NULL;
-   
-    result = g_strdup(PyString_AsString(obj));
-    Py_DECREF(obj);
-   
-    return result;
-}
-
-static PyObject *
-pyg_option_group_set_translate_func(PyGOptionGroup *self, PyObject *args)
-{
-    PyObject *translate, *arg = NULL;
-    if(check_if_owned(self)) return NULL;
-
-    if(self->group == NULL)
-    {
-        PyErr_SetString(PyExc_RuntimeError, "The corresponding GOptionGroup was already freed, probably through the release of GOptionContext");
-        return NULL;
-    }
-    if(! PyArg_ParseTuple(args, "O|O:GOptionGroup.set_translate_func", &translate, &arg))
-        return NULL;
-
-    if(! (PyCallable_Check(translate) || translate == Py_None))
-    {
-        PyErr_SetString(PyExc_TypeError, "gobject.GOptionGroup.set_translate_func expects a callable.");
-        return NULL;
-    }
-
-
-    Py_CLEAR(self->translate_func_arg);
-    self->translate_func_arg = arg;
-    Py_XINCREF(self->translate_func_arg);
-
-    Py_CLEAR(self->translate_func);
-    if(translate == Py_None)
-    {
-        g_option_group_set_translate_func(self->group, NULL, NULL, NULL);
-    }
-    else
-    {
-        self->translate_func = translate;
-        Py_INCREF(self->translate_func);
-        g_option_group_set_translate_func(self->group, 
-                                          (GTranslateFunc) translate_func, 
-                                          self, NULL);
-    }
-    Py_RETURN_NONE;    
-}
-
-static PyObject *
-pyg_option_group_set_translation_domain(PyGOptionGroup *self, PyObject *args)
-{
-    char *domain;
-    if(check_if_owned(self)) return NULL;
-
-    if(self->group == NULL)
-    {
-        PyErr_SetString(PyExc_RuntimeError, "The corresponding GOptionGroup was already freed, probably through the release of GOptionContext");
-        return NULL;
-    }
-    if(! PyArg_ParseTuple(args, "z:GOptionGroup.set_translate_domain", &domain))
-        return NULL;
-    g_option_group_set_translation_domain(self->group, domain);
-    Py_RETURN_NONE;    
-}
-
-static int
-pyg_option_group_compare(PyGOptionGroup *self, PyGOptionGroup *group)
-{
-    if(self->group == group->group) return 0;
-    if(self->group > group->group)
-        return 1;
-    return -1;
-}
-
-static PyMethodDef pyg_option_group_methods[] = {
-    { "add_entries", (PyCFunction)pyg_option_group_add_entries, METH_O },
-    { "set_parse_hooks", (PyCFunction)pyg_option_group_set_parse_hooks, METH_VARARGS },
-    { "set_error_hook", (PyCFunction)pyg_option_group_set_error_hook, METH_VARARGS },
-    { "set_translate_func", (PyCFunction)pyg_option_group_set_translate_func, METH_VARARGS },
-    { "set_translation_domain", (PyCFunction)pyg_option_group_set_translation_domain, METH_VARARGS },
-    { NULL, NULL, 0 },
-};
-
-PyTypeObject PyGOptionGroup_Type = {
-    PyObject_HEAD_INIT(NULL)
-    0,
-    "gobject.OptionGroup",
-    sizeof(PyGOptionGroup),
-    0,
-    /* methods */
-    (destructor)pyg_option_group_dealloc,
-    (printfunc)0,
-    (getattrfunc)0,
-    (setattrfunc)0,
-    (cmpfunc)pyg_option_group_compare,
-    (reprfunc)0,
-    0,
-    0,
-    0,
-    (hashfunc)0,
-    (ternaryfunc)0,
-    (reprfunc)0,
-    (getattrofunc)0,
-    (setattrofunc)0,
-    0,
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
-    NULL,
-    (traverseproc)0,
-    (inquiry)0,
-    (richcmpfunc)0,
-    0,
-    (getiterfunc)0,
-    (iternextfunc)0,
-    pyg_option_group_methods,
-    0,
-    0,
-    NULL,
-    NULL,
-    (descrgetfunc)0,
-    (descrsetfunc)0,
-    0,
-    (initproc)pyg_option_group_init,
-};
-
-/**
- * pyg_option_group_transfer_group:
- * @group: a GOptionGroup wrapper
- *
- * This is used to transfer the GOptionGroup to a GOptionContext. After this
- * is called, the calle must handle the release of the GOptionGroup.
- *
- * When #NULL is returned, the GOptionGroup was already transfered.
- *
- * Returns: Either #NULL or the wrapped GOptionGroup.
- */
-GOptionGroup *
-pyg_option_group_transfer_group(PyGOptionGroup *self)
-{
-    if(self->is_in_context) return NULL;
-    self->is_in_context = TRUE;
-    
-    /* Here we increase the reference count of the PyGOptionGroup, because now
-     * the GOptionContext holds an reference to us (it is the userdata passed
-     * to g_option_group_new().
-     *
-     * The GOptionGroup is freed with the GOptionContext.
-     *
-     * We set it here because if we would do this in the init method we would
-     * hold two references and the PyGOptionGroup would never be freed.
-     */
-    Py_INCREF(self);
-    
-    return self->group;
-}
-
-/**
- * pyg_option_group_new:
- * @group: a GOptionGroup
- *
- * The returned GOptionGroup can't be used to set any hooks, translation domains
- * or add entries. It's only intend is, to use for GOptionContext.add_group().
- *
- * Returns: the GOptionGroup wrapper.
- */
-PyObject * 
-pyg_option_group_new (GOptionGroup *group)
-{
-    PyGOptionGroup *self;
-
-    self = (PyGOptionGroup *)PyObject_NEW(PyGOptionGroup,
-					  &PyGOptionGroup_Type);
-    if (self == NULL)
-	return NULL;
-
-    self->group = group;
-    self->other_owner = TRUE;
-    self->is_in_context = FALSE;
-        
-    return (PyObject *)self;
-}
--- pygobject/examples/option.py	2006-04-15 13:52:56.000000000 +0200
+++ gnome-python/pygobject/examples/option.py	1970-01-01 01:00:00.000000000 +0100
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-# gnome-python/pygobject/examples/option.py
-
-from gobject.goption import *
-import gobject
-
-def example_get_group():
-    """This is only to show how gtk.get_option_group() can be used.
-    """    
-    
-    g = gobject.GOptionGroup("get-example", "GOptionGroup Example", "Show options for the example group.")
-    
-    g.add_entries([("option", "o", 0, gobject.OPTION_ARG_NONE, "test", "Does nothing", "")])
-    
-    return g
-
-group = OptionGroup("group example", "OptionGroup Example", "Shows all example options",
-    option_list = [
-        make_option("--example", type="bool", action="store_true", dest="example",
-                    nargs=1),
-    ])
-
-parser = OptionParser("NAMES ...", 
-    description="A simple gobject.goption example.",
-    option_list = [
-        make_option("--file", "-f", type="filename", action="store", dest="file",
-                    nargs=1),
-        # ...
-    ])
-
-parser.add_option_group(example_get_option_group())
-parser.add_option_group(group)
-
-parser.parse_args()
-
-print "group: example ", group.values.example
-print "parser: file", parser.values.file
--- pygobject/gobject/option.py	2006-04-16 11:09:10.000000000 +0200
+++ gnome-python/pygobject/gobject/option.py	1970-01-01 01:00:00.000000000 +0100
@@ -1,307 +0,0 @@
-# -*- Mode: Python; py-indent-offset: 4 -*-
-# pygobject - Python bindings for the GObject library
-# Copyright (C) 2006  Johannes Hoelzl
-#
-#   gobject/option.py: GOption command line parser 
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
-"""GOption command line parser
-
-Extends optparse to use the GOptionGroup, GOptionEntry and GOptionContext
-objects. So it is possible to use the gtk, gnome_program and gstreamer command
-line groups and contexts.
-
-Use this interface instead of the raw wrappers of GOptionContext and
-GOptionGroup in gobject.
-"""
-
-import sys
-import optparse
-from optparse    import OptionError
-import _gobject as gobject
-
-__all__ = [
-    "OptionError",
-    "Option",
-    "OptionGroup",
-    "OptionParser",
-    "make_option",
-]
-
-class Option(optparse.Option):
-    """Represents a command line option
-
-    To use the extended possibilities of the GOption API Option
-    (and make_option) are extended with new types and attributes.
-
-    Types:
-        filename   The supplied arguments are read as filename, GOption
-                   parses this type in with the GLIB filename encoding.
-
-    Attributes:
-        optional_arg  This does not need a arguement, but it can be supplied.
-        hidden        The help list does not show this option
-        in_main       This option apears in the main group, this should only
-                      be used for backwards compatibility.
-
-    For further help, see optparse.Option.
-    """
-    TYPES = optparse.Option.TYPES + (
-        'filename', 
-    )
-
-    ATTRS = optparse.Option.ATTRS + [
-        'hidden',
-        'in_main',
-        'optional_arg',
-    ]
-
-    def __init__(self, *args, **kwargs):
-        optparse.Option.__init__(self, *args, **kwargs)
-        if not self._long_opts:
-            raise ValueError("%s at least one long option name.")
-
-        if len(self._long_opts) < len(self._short_opts):
-            raise ValueError("%s at least more long option names than short option names.")
-        
-        if not self.help:
-            raise ValueError("%s needs a help message.", self._long_opts[0])
-
-    
-    def _set_opt_string(self, opts):
-        optparse.Option._set_opt_string(self, opts)
-        if len(self._short_opts) > len(self._long_opts):
-            raise OptionError("goption.Option needs more long option names "
-                              "than short option names")
-
-    def _to_goptionentries(self):
-        flags = 0
-        
-        if self.hidden:
-            self.flags |= gobject.OPTION_FLAG_HIDDEN
-        
-        if self.in_main:
-            self.flags |= gobject.OPTION_FLAG_IN_MAIN
-        
-        if self.takes_value():
-            if self.optional_arg:
-                flags |= gobject.OPTION_FLAG_OPTIONAL_ARG
-        else:
-            flags |= gobject.OPTION_FLAG_NO_ARG
-            
-        if self.type == 'filename':
-            flags |= gobject.OPTION_FLAG_FILENAME
-
-        for (long_name, short_name) in zip(self._long_opts, self._short_opts):
-            yield (long_name[2:], short_name[1], flags, self.help, self.metavar)
-            
-        for long_name in self._long_opts[len(self._short_opts):]:
-            yield (long_name[2:], '\0', flags, self.help, self.metavar)
-
-class OptionGroup(optparse.OptionGroup):
-    """A group of command line options.
-
-    Arguements:
-       name:             The groups name, used to create the --help-{name} option
-       description:      Shown as title of the groups help view
-       help_description: Shown as help to the --help-{name} option
-       option_list:      The options used in this group, must be option.Option()
-       defaults:         A dicitionary of default values
-       pre_hook:         Gets called before the first option is parsed.
-       post_hook:        Gets called after the last option is parsed.
-       error_hook:       Gets called when an error occurs.
-       translation_domain: Sets the translation domain for gettext().
-       translation_func: Translates strings for the user visible strings for
-                         --help output. If you are using gettext(), you only
-                         need to set the translation domain.
-
-    NOTE: This OptionGroup does not exactly map the optparse.OptionGroup
-          interface. There is no parser object to supply, but it is possible
-          to set default values and option_lists. Also the default values and
-          values are not shared with the OptionParser.
-
-    To pass a OptionGroup into a function which expects a GOptionGroup (e.g.
-    gnome_program_init() ). OptionGroup.get_option_group() can be used.
-
-    For further help, see optparse.OptionGroup.
-    """
-    def __init__(self, name, description, help_description="", 
-                 option_list=None, defaults=None,
-                 pre_hook=None, post_hook=None, error_hook=None,
-                 translation_domain=None, translate_func=None):
-        optparse.OptionContainer.__init__(self, Option, 'error', description)
-        self.name = name
-        self.parser = None
-        self.help_description = help_description
-        if defaults:
-            self.defaults = defaults
-        
-        self.values = None
-
-        self.pre_hook = pre_hook
-        self.post_hook = post_hook
-        self.error_hook = error_hook
-        self.translation_domain = translation_domain
-        self.translate_func = translate_func
-        
-        for option in option_list:
-            self.add_option(option)
-    
-    def _create_option_list(self):
-        self.option_list = []
-        self._create_option_mappings()
-        
-    def _to_goptiongroup(self, parser):
-        def callback(option_name, option_value, group):
-            if option_name.startswith('--'):
-                opt = self._long_opt[option_name]
-            else:            
-                opt = self._short_opt[option_name]
-            opt.process(option_name, option_value, self.values, parser)
-                
-        group = gobject.OptionGroup(self.name, self.description, 
-                                    self.help_description, callback)
-        if self.pre_hook or self.post_hook:
-            group.set_parse_hooks(lambda g:self.pre_hook(self), lambda g:self.post_hook(self))
-        if self.error_hook:
-            group.set_error_hook(lambda g:self.error_hook(self))
-        if self.translate_func:
-            group.set_translate_func(lambda s, g: self.translate_func(s, self))
-        if self.translation_domain:
-            group.set_translation_domain(self.translation_domain)
-        
-        entries = []
-        for option in self.option_list:
-            entries.extend(option._to_goptionentries())
-        group.add_entries(entries)
-        
-        return group
-    
-    def get_option_group(self, parser = None):
-        """ Returns the corresponding GOptionGroup object.
-        
-        Can be used as parameter for gnome_program_init(), gtk_init().
-        """
-        self.set_values_to_defaults()
-        return self._to_goptiongroup(parser)
-
-    def set_values_to_defaults(self):
-        for option in self.option_list:
-            default = self.defaults.get(option.dest)
-            if isinstance(default, basestring):
-                opt_str = option.get_opt_string()
-                self.defaults[option.dest] = option.check_value(opt_str, default)
-        self.values = optparse.Values(self.defaults)
-    
-class OptionParser(optparse.OptionParser):
-    """Command line parser with GOption support.
-
-    NOTE: The OptionParser interface is not the exactly the same as the
-          optparse.Optionparser interface. Especially the usage parameter
-          is only used to show the metavar of the arguements.
-
-    Attribues:
-        help_enabled:           The --help, --help-all and --help-{group}
-                                options are enabled (default).
-        ignore_unknown_options: Do not throw a exception when a option is not
-                                knwon, the option will be in the result list.
-    
-    OptionParser.add_option_group() does not only accept OptionGroup instances
-    but also gobject.OptionGroup, which is returned by gtk_get_option_group().
-
-    Only gobject.option.OptionGroup and gobject.option.Option instances should
-    be passed as groups and options.
-
-    For further help, see optparse.OptionParser.
-    """
-    
-    def __init__(self, *args, **kwargs):
-        if 'option_class' not in kwargs:
-            kwargs['option_class'] = Option
-        self.help_enabled = kwargs.pop('help_enabled', True)
-        self.ignore_unknown_options = kwargs.pop('ignore_unknown_options', False)
-        optparse.OptionParser.__init__(self, add_help_option=False, *args, **kwargs)
-        
-    def set_usage(self, usage):
-        if usage is None:
-            self.usage = ''
-        elif usage.startswith("%prog"):
-            self.usage = usage[len("%prog"):]
-        else:
-            self.usage = usage
-
-    def _to_goptioncontext(self, values):
-        if self.description:
-            parameter_string = self.usage + " - " + self.description
-        else:
-            parameter_string = self.usage
-        context = gobject.OptionContext(parameter_string)
-        context.set_help_enabled(self.help_enabled)
-        context.set_ignore_unknown_options(self.ignore_unknown_options)
-        
-        for option_group in self.option_groups:
-            if isinstance(option_group, gobject.OptionGroup):
-                g_group = option_group
-            else:
-                g_group = option_group.get_option_group(self)
-            context.add_group(g_group)
-
-        def callback(option_name, option_value, group):
-            if option_name.startswith('--'):
-                opt = self._long_opt[option_name]
-            else:
-                opt = self._short_opt[option_name]
-            opt.process(option_name, option_value, values, self)
-
-        main_group = gobject.OptionGroup(None, None, None, callback)
-        main_entries = []
-        for option in self.option_list:
-            main_entries.extend(option._to_goptionentries())
-        main_group.add_entries(main_entries)
-        context.set_main_group(main_group)
-
-        return context
-    
-    def add_option_group(self, *args, **kwargs):
-        if isinstance(args[0], basestring):
-            optparse.OptionParser.add_option_group(self,
-                OptionGroup(self, *args, **kwargs))
-            return
-        elif len(args) == 1 and not kwargs:
-            if isinstance(args[0], OptionGroup):
-                if not args[0].parser:
-                    args[0].parser = self
-                if args[0].parser is not self:
-                    raise ValueError("invalid OptionGroup (wrong parser)")
-            if isinstance(args[0], gobject.OptionGroup):
-                self.option_groups.append(args[0])
-                return
-        optparse.OptionParser.add_option_group(self, *args, **kwargs)
-
-    def _get_all_options(self):
-        options = self.option_list[:]
-        for group in self.option_groups:
-            if isinstance(group, optparse.OptionGroup):
-                options.extend(group.option_list)
-        return options
-    
-    def _process_args(self, largs, rargs, values):
-        context = self._to_goptioncontext(values)
-        largs.extend(context.parse([sys.argv[0]] + rargs))
-
-
-make_option = Option
--- pygobject/tests/test_option.py	2006-04-16 11:08:26.000000000 +0200
+++ gnome-python/pygobject/tests/test_option.py	1970-01-01 01:00:00.000000000 +0100
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-
-import unittest
-
-from common import gobject
-from gobject import option
-
-class TestOption(unittest.TestCase):
-
-    def setup_group(self):
-        def pre_hook(group):
-            group.events.append('pre')
-        def post_hook(group):
-            group.events.append('post')
-        def error_hook(group):
-            group.events.append('error')
-        group = option.OptionGroup(
-            "unittest", "Unit test options", "Show all unittest options",
-            option_list = [
-                option.make_option("-f", "-u", "--file", "--unit-file",
-                                   help="Unit test option",
-                                   action="append",
-                                   type="filename",
-                                   dest="unit_file"),
-            ], pre_hook = pre_hook, post_hook = post_hook)
-        group.add_option("-t", "--test", help="Unit test option",
-                         action="store_false", dest="test", default=True)
-        group.events = []
-        return group
-
-    def setup_parser(self):
-        parser = option.OptionParser("NAMES...", description="Option unit test")
-        parser.add_option("-t", "--test", help="Unit test option",
-                          action="store_false", dest="test", default=True)
-        return parser
-    
-    def testOption(self):
-        parser = self.setup_parser()
-        group = self.setup_group()
-        parser.add_option_group(group)
-
-        parser.parse_args(["test_option.py", "--test"])
-        assert group.values.test
-        assert not parser.values.test
-        assert group.events == ['pre', 'post']
