bt2: import public names into `__init__.py`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 24 Jul 2019 18:31:59 +0000 (14:31 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Aug 2019 18:05:19 +0000 (14:05 -0400)
commitd016011deb0073f3962ca60cc8319117b5d1a446
tree7450d390c061c815c89507202ba79b2e538b1e27
parentede525fdda8d9dc281117239c694b2cfcd7a409c
bt2: import public names into `__init__.py`

This patch updates `__init__.py.in` so that it imports exactly the names
which we want to make public (available directly in the `bt2` package).

Most public names which start with `_` exist to be able to test if a
given object is an instance of that type, for example:

    if isinstance(val, bt2._IntegerValue):
        # do something with `val` knowing it's an integer value

`bt2._Error` exists to catch it:

    try:
        # ...
    except bt2._Error as exc:
        # ...

`bt2._User*` names exist to inherit them.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I67c7bed00bdffcd0b1fe63603820ecbe2867ec7a
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1768
Tested-by: jenkins <jenkins@lttng.org>
src/bindings/python/bt2/bt2/__init__.py.in
src/bindings/python/bt2/bt2/component.py
src/bindings/python/bt2/bt2/event.py
src/bindings/python/bt2/bt2/stream_class.py
src/bindings/python/bt2/bt2/trace_class.py
tests/bindings/python/bt2/test_connection.py
This page took 0.043904 seconds and 4 git commands to generate.