Commit | Line | Data |
---|---|---|
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 | ||
23 | __version__ = '@PACKAGE_VERSION@' | |
24 | ||
25 | ||
d016011d PP |
26 | from bt2.clock_class import ClockClassOffset |
27 | from bt2.clock_snapshot import _ClockSnapshot | |
28 | from bt2.clock_snapshot import _UnknownClockSnapshot | |
29 | from bt2.component import _SourceComponentClass | |
ede525fd PP |
30 | from bt2.component import _FilterComponentClass |
31 | from bt2.component import _SinkComponentClass | |
f6a5e476 | 32 | from bt2.component import _SourceComponent |
d016011d PP |
33 | from bt2.component import _FilterComponent |
34 | from bt2.component import _SinkComponent | |
35 | from bt2.component import _UserSourceComponent | |
f6a5e476 PP |
36 | from bt2.component import _UserFilterComponent |
37 | from bt2.component import _UserSinkComponent | |
d016011d PP |
38 | from bt2.error import ComponentClassType |
39 | from bt2.error import _ErrorCause | |
40 | from bt2.error import _ComponentErrorCause | |
41 | from bt2.error import _ComponentClassErrorCause | |
42 | from bt2.error import _MessageIteratorErrorCause | |
614743a5 | 43 | from bt2.error import _Error |
d016011d PP |
44 | from bt2.event_class import EventClassLogLevel |
45 | from bt2.field import _IntegerField | |
46 | from bt2.field import _UnsignedIntegerField | |
47 | from bt2.field import _SignedIntegerField | |
48 | from bt2.field import _RealField | |
49 | from bt2.field import _EnumerationField | |
50 | from bt2.field import _UnsignedEnumerationField | |
51 | from bt2.field import _SignedEnumerationField | |
52 | from bt2.field import _StringField | |
53 | from bt2.field import _StructureField | |
54 | from bt2.field import _VariantField | |
55 | from bt2.field import _ArrayField | |
56 | from bt2.field import _StaticArrayField | |
57 | from bt2.field import _DynamicArrayField | |
58 | from bt2.field_class import IntegerDisplayBase | |
59 | from bt2.field_class import _IntegerFieldClass | |
60 | from bt2.field_class import _UnsignedIntegerFieldClass | |
61 | from bt2.field_class import _SignedIntegerFieldClass | |
62 | from bt2.field_class import _RealFieldClass | |
63 | from bt2.field_class import _EnumerationFieldClass | |
64 | from bt2.field_class import _UnsignedEnumerationFieldClass | |
65 | from bt2.field_class import _SignedEnumerationFieldClass | |
66 | from bt2.field_class import _StringFieldClass | |
67 | from bt2.field_class import _StructureFieldClass | |
68 | from bt2.field_class import _VariantFieldClass | |
69 | from bt2.field_class import _VariantFieldClassWithoutSelector | |
70 | from bt2.field_class import _VariantFieldClassWithSelector | |
71 | from bt2.field_class import _VariantFieldClassWithUnsignedSelector | |
72 | from bt2.field_class import _VariantFieldClassWithSignedSelector | |
73 | from bt2.field_class import _ArrayFieldClass | |
74 | from bt2.field_class import _StaticArrayFieldClass | |
75 | from bt2.field_class import _DynamicArrayFieldClass | |
76 | from bt2.field_path import Scope | |
77 | from bt2.field_path import _IndexFieldPathItem | |
78 | from bt2.field_path import _CurrentArrayElementFieldPathItem | |
79 | from bt2.graph import Graph | |
80 | from bt2.integer_range_set import SignedIntegerRange | |
81 | from bt2.integer_range_set import UnsignedIntegerRange | |
82 | from bt2.integer_range_set import SignedIntegerRangeSet | |
83 | from bt2.integer_range_set import UnsignedIntegerRangeSet | |
84 | from bt2.interrupter import Interrupter | |
85 | from bt2.logging import LoggingLevel | |
86 | from bt2.logging import get_minimal_logging_level | |
87 | from bt2.logging import get_global_logging_level | |
88 | from bt2.logging import set_global_logging_level | |
89 | from bt2.message import _EventMessage | |
90 | from bt2.message import _PacketBeginningMessage | |
91 | from bt2.message import _PacketEndMessage | |
92 | from bt2.message import _StreamBeginningMessage | |
93 | from bt2.message import _StreamEndMessage | |
94 | from bt2.message import _MessageIteratorInactivityMessage | |
fa4c33e3 SM |
95 | from bt2.message import _DiscardedEventsMessage |
96 | from bt2.message import _DiscardedPacketsMessage | |
fa4c33e3 | 97 | from bt2.message_iterator import _UserMessageIterator |
d016011d PP |
98 | from bt2.plugin import find_plugins_in_path |
99 | from bt2.plugin import find_plugins | |
100 | from bt2.plugin import find_plugin | |
101 | from bt2.py_plugin import plugin_component_class | |
102 | from bt2.py_plugin import register_plugin | |
103 | from bt2.query_executor import QueryExecutor | |
104 | from bt2.trace_collection_message_iterator import ComponentSpec | |
105 | from bt2.trace_collection_message_iterator import TraceCollectionMessageIterator | |
106 | from bt2.value import create_value | |
107 | from bt2.value import BoolValue | |
68d9d039 | 108 | from bt2.value import _IntegerValue |
d016011d PP |
109 | from bt2.value import UnsignedIntegerValue |
110 | from bt2.value import SignedIntegerValue | |
111 | from bt2.value import RealValue | |
112 | from bt2.value import StringValue | |
113 | from bt2.value import ArrayValue | |
114 | from bt2.value import MapValue | |
81447b5b PP |
115 | |
116 | ||
614743a5 | 117 | class _MemoryError(_Error): |
493428a0 | 118 | '''Raised when an operation fails due to memory issues.''' |
81447b5b PP |
119 | |
120 | ||
3b2be708 | 121 | class InvalidObject(Exception): |
1286dcbb PP |
122 | pass |
123 | ||
124 | ||
64e96b5d | 125 | class _OverflowError(OverflowError): |
81447b5b PP |
126 | pass |
127 | ||
128 | ||
fb25b9e3 | 129 | class TryAgain(Exception): |
81447b5b PP |
130 | pass |
131 | ||
132 | ||
fb25b9e3 PP |
133 | class Stop(StopIteration): |
134 | pass | |
135 | ||
136 | ||
64e96b5d | 137 | class _IncompleteUserClass(Exception): |
f6a5e476 PP |
138 | pass |
139 | ||
140 | ||
5c8b3186 PP |
141 | def _init_and_register_exit(): |
142 | import bt2.native_bt as _native_bt | |
143 | import atexit | |
144 | ||
fb25b9e3 | 145 | atexit.register(_native_bt.bt2_cc_exit_handler) |
61d96b89 FD |
146 | version = ( |
147 | _native_bt.version_get_major(), | |
148 | _native_bt.version_get_minor(), | |
149 | _native_bt.version_get_patch(), | |
150 | _native_bt.version_get_extra(), | |
151 | ) | |
fb25b9e3 | 152 | _native_bt.bt2_cc_init_from_bt2() |
5c8b3186 PP |
153 | |
154 | ||
155 | _init_and_register_exit() | |
156 | ||
f6a5e476 PP |
157 | |
158 | try: | |
159 | del native_bt | |
160 | except: | |
161 | pass |