1 # The MIT License (MIT)
3 # Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
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:
12 # The above copyright notice and this permission notice shall be included in
13 # all copies or substantial portions of the Software.
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
23 __version__
= '@PACKAGE_VERSION@'
26 # import all public names
27 from bt2
.clock_class
import ClockClassOffset
28 from bt2
.clock_snapshot
import _ClockSnapshot
29 from bt2
.clock_snapshot
import _UnknownClockSnapshot
30 from bt2
.component
import _SourceComponentClass
31 from bt2
.component
import _FilterComponentClass
32 from bt2
.component
import _SinkComponentClass
33 from bt2
.component
import _SourceComponent
34 from bt2
.component
import _FilterComponent
35 from bt2
.component
import _SinkComponent
36 from bt2
.component
import _UserSourceComponent
37 from bt2
.component
import _UserFilterComponent
38 from bt2
.component
import _UserSinkComponent
39 from bt2
.error
import ComponentClassType
40 from bt2
.error
import _ErrorCause
41 from bt2
.error
import _ComponentErrorCause
42 from bt2
.error
import _ComponentClassErrorCause
43 from bt2
.error
import _MessageIteratorErrorCause
44 from bt2
.error
import _Error
45 from bt2
.event_class
import EventClassLogLevel
46 from bt2
.field
import _IntegerField
47 from bt2
.field
import _UnsignedIntegerField
48 from bt2
.field
import _SignedIntegerField
49 from bt2
.field
import _RealField
50 from bt2
.field
import _EnumerationField
51 from bt2
.field
import _UnsignedEnumerationField
52 from bt2
.field
import _SignedEnumerationField
53 from bt2
.field
import _StringField
54 from bt2
.field
import _StructureField
55 from bt2
.field
import _VariantField
56 from bt2
.field
import _ArrayField
57 from bt2
.field
import _StaticArrayField
58 from bt2
.field
import _DynamicArrayField
59 from bt2
.field_class
import IntegerDisplayBase
60 from bt2
.field_class
import _IntegerFieldClass
61 from bt2
.field_class
import _UnsignedIntegerFieldClass
62 from bt2
.field_class
import _SignedIntegerFieldClass
63 from bt2
.field_class
import _RealFieldClass
64 from bt2
.field_class
import _EnumerationFieldClass
65 from bt2
.field_class
import _UnsignedEnumerationFieldClass
66 from bt2
.field_class
import _SignedEnumerationFieldClass
67 from bt2
.field_class
import _StringFieldClass
68 from bt2
.field_class
import _StructureFieldClass
69 from bt2
.field_class
import _VariantFieldClass
70 from bt2
.field_class
import _VariantFieldClassWithoutSelector
71 from bt2
.field_class
import _VariantFieldClassWithSelector
72 from bt2
.field_class
import _VariantFieldClassWithUnsignedSelector
73 from bt2
.field_class
import _VariantFieldClassWithSignedSelector
74 from bt2
.field_class
import _ArrayFieldClass
75 from bt2
.field_class
import _StaticArrayFieldClass
76 from bt2
.field_class
import _DynamicArrayFieldClass
77 from bt2
.field_path
import Scope
78 from bt2
.field_path
import _IndexFieldPathItem
79 from bt2
.field_path
import _CurrentArrayElementFieldPathItem
80 from bt2
.graph
import Graph
81 from bt2
.integer_range_set
import SignedIntegerRange
82 from bt2
.integer_range_set
import UnsignedIntegerRange
83 from bt2
.integer_range_set
import SignedIntegerRangeSet
84 from bt2
.integer_range_set
import UnsignedIntegerRangeSet
85 from bt2
.interrupter
import Interrupter
86 from bt2
.logging
import LoggingLevel
87 from bt2
.logging
import get_minimal_logging_level
88 from bt2
.logging
import get_global_logging_level
89 from bt2
.logging
import set_global_logging_level
90 from bt2
.message
import _EventMessage
91 from bt2
.message
import _PacketBeginningMessage
92 from bt2
.message
import _PacketEndMessage
93 from bt2
.message
import _StreamBeginningMessage
94 from bt2
.message
import _StreamEndMessage
95 from bt2
.message
import _MessageIteratorInactivityMessage
96 from bt2
.message
import _DiscardedEventsMessage
97 from bt2
.message
import _DiscardedPacketsMessage
98 from bt2
.message_iterator
import _UserMessageIterator
99 from bt2
.plugin
import find_plugins_in_path
100 from bt2
.plugin
import find_plugins
101 from bt2
.plugin
import find_plugin
102 from bt2
.py_plugin
import plugin_component_class
103 from bt2
.py_plugin
import register_plugin
104 from bt2
.query_executor
import QueryExecutor
105 from bt2
.trace_collection_message_iterator
import ComponentSpec
106 from bt2
.trace_collection_message_iterator
import TraceCollectionMessageIterator
107 from bt2
.value
import create_value
108 from bt2
.value
import BoolValue
109 from bt2
.value
import _IntegerValue
110 from bt2
.value
import UnsignedIntegerValue
111 from bt2
.value
import SignedIntegerValue
112 from bt2
.value
import RealValue
113 from bt2
.value
import StringValue
114 from bt2
.value
import ArrayValue
115 from bt2
.value
import MapValue
118 def _del_global_name(name
):
119 if name
in globals():
123 # remove private module names from the package
124 _del_global_name('_native_bt')
125 _del_global_name('clock_class')
126 _del_global_name('clock_snapshot')
127 _del_global_name('component')
128 _del_global_name('connection')
129 _del_global_name('error')
130 _del_global_name('event')
131 _del_global_name('event_class')
132 _del_global_name('field')
133 _del_global_name('field_class')
134 _del_global_name('field_path')
135 _del_global_name('graph')
136 _del_global_name('integer_range_set')
137 _del_global_name('interrupter')
138 _del_global_name('logging')
139 _del_global_name('message')
140 _del_global_name('message_iterator')
141 _del_global_name('native_bt')
142 _del_global_name('object')
143 _del_global_name('packet')
144 _del_global_name('plugin')
145 _del_global_name('port')
146 _del_global_name('py_plugin')
147 _del_global_name('query_executor')
148 _del_global_name('stream')
149 _del_global_name('stream_class')
150 _del_global_name('trace')
151 _del_global_name('trace_class')
152 _del_global_name('trace_collection_message_iterator')
153 _del_global_name('utils')
154 _del_global_name('value')
156 # remove private `_del_global_name` name from the package
160 class _MemoryError(_Error
):
161 '''Raised when an operation fails due to memory issues.'''
164 class InvalidObject(Exception):
168 class _OverflowError(OverflowError):
172 class TryAgain(Exception):
176 class Stop(StopIteration):
180 class _IncompleteUserClass(Exception):
184 def _init_and_register_exit():
185 from bt2
import native_bt
188 atexit
.register(native_bt
.bt2_cc_exit_handler
)
189 native_bt
.bt2_cc_init_from_bt2()
192 _init_and_register_exit()
194 # remove private `_init_and_register_exit` name from the package
195 del _init_and_register_exit