bt2: import public names into `__init__.py`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 24 Jul 2019 18:31:59 +0000 (14:31 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 25 Jul 2019 18:04:47 +0000 (14:04 -0400)
commit5290f876138c2b71026bd2bbed78077b68cf961a
treeb4d16af5d0281b289ec679c3af56adce2592df33
parent68e606effd31ee0b35d243f0c406c8af0f4a7b17
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.025615 seconds and 4 git commands to generate.