summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2001-09-15 02:55:58 +0000
committerJames Henstridge <jamesh@src.gnome.org>2001-09-15 02:55:58 +0000
commitd7349b5905548799554bb351634a31513843e415 (patch)
tree55ef7c31e7b1915105c124f4a9f395b209779a92
parent7c9fece492ca63668f5ce3cd64553811adf4f6c2 (diff)
downloadpygobject-d7349b5905548799554bb351634a31513843e415.tar.gz
pygobject-d7349b5905548799554bb351634a31513843e415.tar.xz
pygobject-d7349b5905548799554bb351634a31513843e415.zip
don't import GTK.
2001-09-15 James Henstridge <james@daa.com.au> * gtk/__init__.py (TRUE): don't import GTK. * gtk/gtkmodule.c (init_gtk): same here. * pangomodule.c (initpango): add constants to the pango module. * codegen/codegen.py (write_enums): new function that writes a function to add constants for all the enums and flags in the parser. (write_source): call write_enums().
-rw-r--r--gobject/gobjectmodule.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 7adbb8b..32c31c7 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -2126,7 +2126,11 @@ pyg_enum_add_constants(PyObject *module, GType enum_type,
guint i, j;
gint prefix_len;
- g_return_if_fail (G_TYPE_IS_ENUM (enum_type));
+ /* a more useful warning */
+ if (!G_TYPE_IS_ENUM(enum_type)) {
+ g_warning("`%s' is not an enum type", g_type_name(enum_type));
+ return;
+ }
g_return_if_fail (strip_prefix != NULL);
prefix_len = strlen(strip_prefix);
@@ -2158,7 +2162,11 @@ pyg_flags_add_constants(PyObject *module, GType flags_type,
guint i, j;
gint prefix_len;
- g_return_if_fail (G_TYPE_IS_FLAGS (flags_type));
+ /* a more useful warning */
+ if (!G_TYPE_IS_FLAGS(flags_type)) {
+ g_warning("`%s' is not an flags type", g_type_name(flags_type));
+ return;
+ }
g_return_if_fail (strip_prefix != NULL);
prefix_len = strlen(strip_prefix);