diff options
author | Johan Dahlin <zilch@src.gnome.org> | 2004-04-10 16:39:39 +0000 |
---|---|---|
committer | Johan Dahlin <zilch@src.gnome.org> | 2004-04-10 16:39:39 +0000 |
commit | 287806047cf293b5935f627b2f26ed9a96a7e958 (patch) | |
tree | bb9aa7cf39d3e8e052c9f493261bb76070fe7ca6 /gtk/gtkmodule.c | |
parent | 4d81aa9f5ee5bda405efaa8a7fd1881a4db59bf1 (diff) | |
download | pygtk-287806047cf293b5935f627b2f26ed9a96a7e958.tar.gz |
Move GtkDeprecatedWarning ... Remove global module import and do it in the
* gtk/__init__.py: Move GtkDeprecatedWarning ...
Remove global module import and do it in the class _Deprecated and
delete _Deprecated when done.
(_Deprecated.__repr__): Add.
* gtk/gtkmodule.c: ... here, and rename it to DeprecatedWarning
Diffstat (limited to 'gtk/gtkmodule.c')
-rw-r--r-- | gtk/gtkmodule.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/gtkmodule.c b/gtk/gtkmodule.c index b7621c07..22ec993f 100644 --- a/gtk/gtkmodule.c +++ b/gtk/gtkmodule.c @@ -40,6 +40,8 @@ void pygdk_add_constants(PyObject *module, const gchar *strip_prefix); extern PyMethodDef pygtk_functions[]; extern PyMethodDef pygdk_functions[]; +PyObject *PyGtkDeprecationWarning; + static struct _PyGtk_FunctionStruct functions = { VERSION, @@ -152,6 +154,10 @@ init_gtk(void) o=PyCObject_FromVoidPtr(&functions, NULL)); Py_DECREF(o); + PyGtkDeprecationWarning = PyErr_NewException("gtk.GtkDeprecationWarning", + PyExc_DeprecationWarning, NULL); + PyDict_SetItemString(d, "DeprecationWarning", PyGtkDeprecationWarning); + stock_ids = gtk_stock_list_ids(); strcpy(buf, "STOCK_"); for (cur = stock_ids; cur; cur = stock_ids) { @@ -184,6 +190,7 @@ init_gtk(void) stock_ids = cur->next; g_slist_free_1(cur); } + /* namespace all the gdk stuff in gtk.gdk ... */ m = Py_InitModule("gtk.gdk", pygdk_functions); d = PyModule_GetDict(m); @@ -210,6 +217,6 @@ init_gtk(void) add_atom(SELECTION_TYPE_WINDOW); add_atom(SELECTION_TYPE_STRING); #undef add_atom - + gtk_timeout_add(100, python_do_pending_calls, NULL); } |