[pygobject/pygobject-2-28] [gtk-override] print warning if user imports Gtk 2.0
- From: John Palmieri <johnp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject/pygobject-2-28] [gtk-override] print warning if user imports Gtk 2.0
- Date: Tue, 28 Jun 2011 17:57:38 +0000 (UTC)
commit 21653d2db4c836f1e5906fa84a02b72fd7bc55d9
Author: John (J5) Palmieri <johnp redhat com>
Date: Tue Jun 28 13:54:48 2011 -0400
[gtk-override] print warning if user imports Gtk 2.0
* this is needed because people file bugs not realizing they are importing 2.0
which is not supported
gi/overrides/Gtk.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 30e883c..b7dd7d7 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -35,6 +35,18 @@ else:
Gtk = modules['Gtk']._introspection_module
__all__ = []
+if Gtk._version == '2.0':
+ import warnings
+ warn_msg = "You have imported the Gtk 2.0 module. Because Gtk 2.0 \
+was not designed for use with introspection some of the \
+interfaces and API will fail. As such this is not supported \
+by the pygobject development team and we encourage you to \
+port your app to Gtk 3 or greater. PyGTK is the recomended \
+python module to use with Gtk 2.0"
+
+ warnings.warn(warn_msg, RuntimeWarning)
+
+
class Widget(Gtk.Widget):
def translate_coordinates(self, dest_widget, src_x, src_y):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]