Bugzilla – Bug 2969
GooCanvas API inconsistency for pyviz bounds resizing
Last modified: 2018-08-14 12:19:16 UTC
This may be a platform-specific, upstream issue. For the new GObject support for PyViz for ns-3.29 and later, the function GooCanvas.Canvas.get_bounds() returns a TypeError on Fedora 26. $ python Python 2.7.14 (default, Mar 14 2018, 13:29:26) [GCC 7.3.1 20180130 (Red Hat 7.3.1-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gi >>> gi.require_version('GooCanvas','2.0') >>> from gi.repository import GooCanvas >>> my_canvas = GooCanvas.Canvas() >>> my_canvas.set_bounds(-1, -1, 1, 1) >>> my_canvas.get_bounds () Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: GooCanvas.Canvas.get_bounds() takes exactly 5 arguments (1 given) >>> quit () However, all documented versions of get_bounds() do not require arguments, and the code runs successfully on Ubuntu 18: $ python Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gi >>> gi.require_version('GooCanvas','2.0') >>> from gi.repository import GooCanvas >>> my_canvas = GooCanvas.Canvas() >>> my_canvas.set_bounds (-1, -1, 1, 1) >>> my_canvas.get_bounds () (left=-1.0, top=-1.0, right=1.0, bottom=1.0) >>> quit () The relevant Fedora packages are: pygobject3-devel gobject-introspection-devel goocanvas2-devel pygobject3-devel.x86_64 3.24.1-1.fc26 gobject-introspection-devel.x86_64 1.52.1-1.fc26 goocanvas2-devel.x86_64 2.0.2-7.fc26 In src/visualizer/visualizer/core.py, there is some code to detect the case where a node has moved outside the bounds, and to resize the bounds. The exception is now being caught, but the result is that bounds resizing will not work on such systems. This tracker issue is to remember this and possibly try to further debug or ask upstream about this issue.