X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fconnection.py;h=aac76dd3dd1a9eb4f9dfc364b8d07bf8d70f4d56;hb=0530003ff4f693e0a582a0ed4a15245455398b4a;hp=4c52a776b32d38c81f5429fd1198f09e9ba487a4;hpb=57952005b6a6a0aeb1e4ecb0d7ac0c6786d23dba;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/connection.py b/src/bindings/python/bt2/bt2/connection.py index 4c52a776..aac76dd3 100644 --- a/src/bindings/python/bt2/bt2/connection.py +++ b/src/bindings/python/bt2/bt2/connection.py @@ -20,24 +20,25 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -from bt2 import native_bt, utils -import bt2.message_iterator -import bt2.port -import bt2 +from bt2 import native_bt +from bt2 import port as bt2_port +from bt2 import object as bt2_object -class _Connection(bt2.object._SharedObject): +class _ConnectionConst(bt2_object._SharedObject): _get_ref = staticmethod(native_bt.connection_get_ref) _put_ref = staticmethod(native_bt.connection_put_ref) @property def downstream_port(self): port_ptr = native_bt.connection_borrow_downstream_port_const(self._ptr) - utils._handle_ptr(port_ptr, "cannot get connection object's downstream port object") - return bt2.port._create_from_ptr_and_get_ref(port_ptr, native_bt.PORT_TYPE_INPUT) + return bt2_port._create_from_const_ptr_and_get_ref( + port_ptr, native_bt.PORT_TYPE_INPUT + ) @property def upstream_port(self): port_ptr = native_bt.connection_borrow_upstream_port_const(self._ptr) - utils._handle_ptr(port_ptr, "cannot get connection object's upstream port object") - return bt2.port._create_from_ptr_and_get_ref(port_ptr, native_bt.PORT_TYPE_OUTPUT) + return bt2_port._create_from_const_ptr_and_get_ref( + port_ptr, native_bt.PORT_TYPE_OUTPUT + )