sink.ctf.fs: write boolean field classes and fields
[babeltrace.git] / src / bindings / python / bt2 / bt2 / __init__.py
CommitLineData
81447b5b
PP
1# The MIT License (MIT)
2#
f6a5e476 3# Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
81447b5b
PP
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
c946c9de 23# import all public names
d016011d
PP
24from bt2.clock_class import ClockClassOffset
25from bt2.clock_snapshot import _ClockSnapshot
26from bt2.clock_snapshot import _UnknownClockSnapshot
27from bt2.component import _SourceComponentClass
ede525fd
PP
28from bt2.component import _FilterComponentClass
29from bt2.component import _SinkComponentClass
f6a5e476 30from bt2.component import _SourceComponent
d016011d
PP
31from bt2.component import _FilterComponent
32from bt2.component import _SinkComponent
33from bt2.component import _UserSourceComponent
f6a5e476
PP
34from bt2.component import _UserFilterComponent
35from bt2.component import _UserSinkComponent
71e8e5c5 36from bt2.component_descriptor import ComponentDescriptor
d016011d
PP
37from bt2.error import ComponentClassType
38from bt2.error import _ErrorCause
39from bt2.error import _ComponentErrorCause
40from bt2.error import _ComponentClassErrorCause
41from bt2.error import _MessageIteratorErrorCause
614743a5 42from bt2.error import _Error
d016011d
PP
43from bt2.event_class import EventClassLogLevel
44from bt2.field import _IntegerField
45from bt2.field import _UnsignedIntegerField
46from bt2.field import _SignedIntegerField
47from bt2.field import _RealField
48from bt2.field import _EnumerationField
49from bt2.field import _UnsignedEnumerationField
50from bt2.field import _SignedEnumerationField
51from bt2.field import _StringField
52from bt2.field import _StructureField
53from bt2.field import _VariantField
54from bt2.field import _ArrayField
55from bt2.field import _StaticArrayField
56from bt2.field import _DynamicArrayField
57from bt2.field_class import IntegerDisplayBase
58from bt2.field_class import _IntegerFieldClass
59from bt2.field_class import _UnsignedIntegerFieldClass
60from bt2.field_class import _SignedIntegerFieldClass
61from bt2.field_class import _RealFieldClass
62from bt2.field_class import _EnumerationFieldClass
63from bt2.field_class import _UnsignedEnumerationFieldClass
64from bt2.field_class import _SignedEnumerationFieldClass
65from bt2.field_class import _StringFieldClass
66from bt2.field_class import _StructureFieldClass
67from bt2.field_class import _VariantFieldClass
68from bt2.field_class import _VariantFieldClassWithoutSelector
69from bt2.field_class import _VariantFieldClassWithSelector
70from bt2.field_class import _VariantFieldClassWithUnsignedSelector
71from bt2.field_class import _VariantFieldClassWithSignedSelector
72from bt2.field_class import _ArrayFieldClass
73from bt2.field_class import _StaticArrayFieldClass
74from bt2.field_class import _DynamicArrayFieldClass
056995e5 75from bt2.field_path import FieldPathScope
d016011d
PP
76from bt2.field_path import _IndexFieldPathItem
77from bt2.field_path import _CurrentArrayElementFieldPathItem
78from bt2.graph import Graph
79from bt2.integer_range_set import SignedIntegerRange
80from bt2.integer_range_set import UnsignedIntegerRange
81from bt2.integer_range_set import SignedIntegerRangeSet
82from bt2.integer_range_set import UnsignedIntegerRangeSet
83from bt2.interrupter import Interrupter
84from bt2.logging import LoggingLevel
85from bt2.logging import get_minimal_logging_level
86from bt2.logging import get_global_logging_level
87from bt2.logging import set_global_logging_level
88from bt2.message import _EventMessage
89from bt2.message import _PacketBeginningMessage
90from bt2.message import _PacketEndMessage
91from bt2.message import _StreamBeginningMessage
92from bt2.message import _StreamEndMessage
93from bt2.message import _MessageIteratorInactivityMessage
fa4c33e3
SM
94from bt2.message import _DiscardedEventsMessage
95from bt2.message import _DiscardedPacketsMessage
fa4c33e3 96from bt2.message_iterator import _UserMessageIterator
ea307835
PP
97from bt2.mip import get_greatest_operative_mip_version
98from bt2.mip import get_maximal_mip_version
d016011d
PP
99from bt2.plugin import find_plugins_in_path
100from bt2.plugin import find_plugins
101from bt2.plugin import find_plugin
102from bt2.py_plugin import plugin_component_class
103from bt2.py_plugin import register_plugin
104from bt2.query_executor import QueryExecutor
94e72386 105from bt2.trace_collection_message_iterator import AutoSourceComponentSpec
d016011d
PP
106from bt2.trace_collection_message_iterator import ComponentSpec
107from bt2.trace_collection_message_iterator import TraceCollectionMessageIterator
108from bt2.value import create_value
109from bt2.value import BoolValue
68d9d039 110from bt2.value import _IntegerValue
d016011d
PP
111from bt2.value import UnsignedIntegerValue
112from bt2.value import SignedIntegerValue
113from bt2.value import RealValue
114from bt2.value import StringValue
115from bt2.value import ArrayValue
116from bt2.value import MapValue
a90c9738 117from bt2.version import __version__
81447b5b
PP
118
119
c946c9de
PP
120def _del_global_name(name):
121 if name in globals():
122 del globals()[name]
123
124
125# remove private module names from the package
126_del_global_name('_native_bt')
127_del_global_name('clock_class')
128_del_global_name('clock_snapshot')
129_del_global_name('component')
130_del_global_name('connection')
131_del_global_name('error')
132_del_global_name('event')
133_del_global_name('event_class')
134_del_global_name('field')
135_del_global_name('field_class')
136_del_global_name('field_path')
137_del_global_name('graph')
138_del_global_name('integer_range_set')
139_del_global_name('interrupter')
140_del_global_name('logging')
141_del_global_name('message')
142_del_global_name('message_iterator')
143_del_global_name('native_bt')
144_del_global_name('object')
145_del_global_name('packet')
146_del_global_name('plugin')
147_del_global_name('port')
148_del_global_name('py_plugin')
149_del_global_name('query_executor')
150_del_global_name('stream')
151_del_global_name('stream_class')
152_del_global_name('trace')
153_del_global_name('trace_class')
154_del_global_name('trace_collection_message_iterator')
155_del_global_name('utils')
156_del_global_name('value')
a90c9738 157_del_global_name('version')
c946c9de
PP
158
159# remove private `_del_global_name` name from the package
160del _del_global_name
161
162
614743a5 163class _MemoryError(_Error):
493428a0 164 '''Raised when an operation fails due to memory issues.'''
81447b5b
PP
165
166
7dd3e712
SM
167class UnknownObject(Exception):
168 '''
169 Raised when a component class handles a query for an object it doesn't
170 know about.
171 '''
172
1286dcbb
PP
173 pass
174
175
35752b44 176class _OverflowError(_Error, OverflowError):
81447b5b
PP
177 pass
178
179
fb25b9e3 180class TryAgain(Exception):
81447b5b
PP
181 pass
182
183
fb25b9e3
PP
184class Stop(StopIteration):
185 pass
186
187
64e96b5d 188class _IncompleteUserClass(Exception):
f6a5e476
PP
189 pass
190
191
5c8b3186 192def _init_and_register_exit():
c946c9de 193 from bt2 import native_bt
5c8b3186
PP
194 import atexit
195
65e28173
PP
196 atexit.register(native_bt.bt2_exit_handler)
197 native_bt.bt2_init_from_bt2()
5c8b3186
PP
198
199
200_init_and_register_exit()
201
c946c9de
PP
202# remove private `_init_and_register_exit` name from the package
203del _init_and_register_exit
This page took 0.053554 seconds and 4 git commands to generate.