bt2: native_bt_version.i: use `%include <babeltrace2/version.h>`
[babeltrace.git] / src / bindings / python / bt2 / bt2 / __init__.py
... / ...
CommitLineData
1# The MIT License (MIT)
2#
3# Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
4#
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to deal
7# in the Software without restriction, including without limitation the rights
8# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9# copies of the Software, and to permit persons to whom the Software is
10# furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included in
13# all copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21# THE SOFTWARE.
22
23# import all public names
24from bt2.clock_class import ClockClassOffset
25from bt2.clock_snapshot import _ClockSnapshot
26from bt2.clock_snapshot import _UnknownClockSnapshot
27from bt2.component import _SourceComponentClass
28from bt2.component import _FilterComponentClass
29from bt2.component import _SinkComponentClass
30from bt2.component import _SourceComponent
31from bt2.component import _FilterComponent
32from bt2.component import _SinkComponent
33from bt2.component import _UserSourceComponent
34from bt2.component import _UserFilterComponent
35from bt2.component import _UserSinkComponent
36from bt2.error import ComponentClassType
37from bt2.error import _ErrorCause
38from bt2.error import _ComponentErrorCause
39from bt2.error import _ComponentClassErrorCause
40from bt2.error import _MessageIteratorErrorCause
41from bt2.error import _Error
42from bt2.event_class import EventClassLogLevel
43from bt2.field import _IntegerField
44from bt2.field import _UnsignedIntegerField
45from bt2.field import _SignedIntegerField
46from bt2.field import _RealField
47from bt2.field import _EnumerationField
48from bt2.field import _UnsignedEnumerationField
49from bt2.field import _SignedEnumerationField
50from bt2.field import _StringField
51from bt2.field import _StructureField
52from bt2.field import _VariantField
53from bt2.field import _ArrayField
54from bt2.field import _StaticArrayField
55from bt2.field import _DynamicArrayField
56from bt2.field_class import IntegerDisplayBase
57from bt2.field_class import _IntegerFieldClass
58from bt2.field_class import _UnsignedIntegerFieldClass
59from bt2.field_class import _SignedIntegerFieldClass
60from bt2.field_class import _RealFieldClass
61from bt2.field_class import _EnumerationFieldClass
62from bt2.field_class import _UnsignedEnumerationFieldClass
63from bt2.field_class import _SignedEnumerationFieldClass
64from bt2.field_class import _StringFieldClass
65from bt2.field_class import _StructureFieldClass
66from bt2.field_class import _VariantFieldClass
67from bt2.field_class import _VariantFieldClassWithoutSelector
68from bt2.field_class import _VariantFieldClassWithSelector
69from bt2.field_class import _VariantFieldClassWithUnsignedSelector
70from bt2.field_class import _VariantFieldClassWithSignedSelector
71from bt2.field_class import _ArrayFieldClass
72from bt2.field_class import _StaticArrayFieldClass
73from bt2.field_class import _DynamicArrayFieldClass
74from bt2.field_path import FieldPathScope
75from bt2.field_path import _IndexFieldPathItem
76from bt2.field_path import _CurrentArrayElementFieldPathItem
77from bt2.graph import Graph
78from bt2.integer_range_set import SignedIntegerRange
79from bt2.integer_range_set import UnsignedIntegerRange
80from bt2.integer_range_set import SignedIntegerRangeSet
81from bt2.integer_range_set import UnsignedIntegerRangeSet
82from bt2.interrupter import Interrupter
83from bt2.logging import LoggingLevel
84from bt2.logging import get_minimal_logging_level
85from bt2.logging import get_global_logging_level
86from bt2.logging import set_global_logging_level
87from bt2.message import _EventMessage
88from bt2.message import _PacketBeginningMessage
89from bt2.message import _PacketEndMessage
90from bt2.message import _StreamBeginningMessage
91from bt2.message import _StreamEndMessage
92from bt2.message import _MessageIteratorInactivityMessage
93from bt2.message import _DiscardedEventsMessage
94from bt2.message import _DiscardedPacketsMessage
95from bt2.message_iterator import _UserMessageIterator
96from bt2.plugin import find_plugins_in_path
97from bt2.plugin import find_plugins
98from bt2.plugin import find_plugin
99from bt2.py_plugin import plugin_component_class
100from bt2.py_plugin import register_plugin
101from bt2.query_executor import QueryExecutor
102from bt2.trace_collection_message_iterator import ComponentSpec
103from bt2.trace_collection_message_iterator import TraceCollectionMessageIterator
104from bt2.value import create_value
105from bt2.value import BoolValue
106from bt2.value import _IntegerValue
107from bt2.value import UnsignedIntegerValue
108from bt2.value import SignedIntegerValue
109from bt2.value import RealValue
110from bt2.value import StringValue
111from bt2.value import ArrayValue
112from bt2.value import MapValue
113from bt2.version import __version__
114
115
116def _del_global_name(name):
117 if name in globals():
118 del globals()[name]
119
120
121# remove private module names from the package
122_del_global_name('_native_bt')
123_del_global_name('clock_class')
124_del_global_name('clock_snapshot')
125_del_global_name('component')
126_del_global_name('connection')
127_del_global_name('error')
128_del_global_name('event')
129_del_global_name('event_class')
130_del_global_name('field')
131_del_global_name('field_class')
132_del_global_name('field_path')
133_del_global_name('graph')
134_del_global_name('integer_range_set')
135_del_global_name('interrupter')
136_del_global_name('logging')
137_del_global_name('message')
138_del_global_name('message_iterator')
139_del_global_name('native_bt')
140_del_global_name('object')
141_del_global_name('packet')
142_del_global_name('plugin')
143_del_global_name('port')
144_del_global_name('py_plugin')
145_del_global_name('query_executor')
146_del_global_name('stream')
147_del_global_name('stream_class')
148_del_global_name('trace')
149_del_global_name('trace_class')
150_del_global_name('trace_collection_message_iterator')
151_del_global_name('utils')
152_del_global_name('value')
153_del_global_name('version')
154
155# remove private `_del_global_name` name from the package
156del _del_global_name
157
158
159class _MemoryError(_Error):
160 '''Raised when an operation fails due to memory issues.'''
161
162
163class UnknownObject(Exception):
164 '''
165 Raised when a component class handles a query for an object it doesn't
166 know about.
167 '''
168
169 pass
170
171
172class _OverflowError(_Error, OverflowError):
173 pass
174
175
176class TryAgain(Exception):
177 pass
178
179
180class Stop(StopIteration):
181 pass
182
183
184class _IncompleteUserClass(Exception):
185 pass
186
187
188def _init_and_register_exit():
189 from bt2 import native_bt
190 import atexit
191
192 atexit.register(native_bt.bt2_cc_exit_handler)
193 native_bt.bt2_cc_init_from_bt2()
194
195
196_init_and_register_exit()
197
198# remove private `_init_and_register_exit` name from the package
199del _init_and_register_exit
This page took 0.023798 seconds and 4 git commands to generate.