python: use gi.require_version() in generate-setting-docs.py and examples
authorThomas Haller <thaller@redhat.com>
Wed, 11 Nov 2015 09:37:07 +0000 (10:37 +0100)
committerThomas Haller <thaller@redhat.com>
Wed, 11 Nov 2015 09:56:05 +0000 (10:56 +0100)
commit8d1233e67e0db2c53717d9bd1bf9935958ffd79a
tree3a70833fe267d67e5c06bc3575fd10a99d570cce
parent0dc48370b48c08300713df611b7c9d3937306be3
python: use gi.require_version() in generate-setting-docs.py and examples

gi now emits a warning when not loading a specific library
version [1]:

  ./generate-setting-docs.py:21: PyGIWarning: NM was imported without specifying a version first. Use gi.require_version(NM, 1.0) before import to ensure that the right version gets loaded.
    from gi.repository import NM, GObject

Seems require_version() is reasonably old to just always use it without
breaking on older versions [2].

[1] Related: https://bugzilla.gnome.org/show_bug.cgi?id=727379
[2] https://git.gnome.org/browse/pygobject/commit/?id=76758efb6579752237a0dc4d56cf9518de6c6e55
examples/python/gi/add_connection.py
examples/python/gi/deactivate-all.py
examples/python/gi/device-state-ip4config.py
examples/python/gi/firewall-zone.py
examples/python/gi/get-active-connections.py
examples/python/gi/get-lldp-neighbors.py
examples/python/gi/get_ips.py
examples/python/gi/list-connections.py
examples/python/gi/show-wifi-networks.py
examples/python/gi/update-ip4-method.py
libnm/generate-setting-docs.py