Commit 4992dca9 authored by Laszlo Pandy's avatar Laszlo Pandy Committed by Tomeu Vizoso
Browse files

Add a __repr__() method to DynamicModule.

This patch adds a __repr__() method to DynamicModule so that modules provide a
meaningful string with the typelib path included:

>>> from gi.repository import Gtk
>>> Gtk
<gi.module.DynamicModule 'Gtk' from
parent 2ffaec59
......@@ -260,3 +260,12 @@ class DynamicModule(object):
result = [info.get_name() for info in namespace_infos]
return result
def __repr__(self):
repository.require(self._namespace, self._version)
path = repository.get_typelib_path(self._namespace)
return "<%s.%s %r from %r>" % (self.__class__.__module__,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment