X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fstream.py;h=dae698d6abc70a531bb34d6ac8a1087ec64af50b;hb=e5914347c8eea0f26c07348d0ac64dbe020de44a;hp=f1329623c2633c780c5bc06f2035c70ef6f6c0cf;hpb=f5567ea88d172767b34373bc6e402da8bfd85ef8;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/stream.py b/src/bindings/python/bt2/bt2/stream.py index f1329623..dae698d6 100644 --- a/src/bindings/python/bt2/bt2/stream.py +++ b/src/bindings/python/bt2/bt2/stream.py @@ -2,7 +2,8 @@ # # Copyright (c) 2016-2017 Philippe Proulx -from bt2 import native_bt, utils +from bt2 import native_bt +from bt2 import utils as bt2_utils from bt2 import object as bt2_object from bt2 import packet as bt2_packet from bt2 import stream_class as bt2_stream_class @@ -17,8 +18,14 @@ def _bt2_trace(): class _StreamConst(bt2_object._SharedObject): - _get_ref = staticmethod(native_bt.stream_get_ref) - _put_ref = staticmethod(native_bt.stream_put_ref) + @staticmethod + def _get_ref(ptr): + native_bt.stream_get_ref(ptr) + + @staticmethod + def _put_ref(ptr): + native_bt.stream_put_ref(ptr) + _borrow_class_ptr = staticmethod(native_bt.stream_borrow_class_const) _borrow_user_attributes_ptr = staticmethod( native_bt.stream_borrow_user_attributes_const @@ -83,7 +90,7 @@ class _Stream(_StreamConst): def _user_attributes(self, user_attributes): value = bt2_value.create_value(user_attributes) - utils._check_type(value, bt2_value.MapValue) + bt2_utils._check_type(value, bt2_value.MapValue) native_bt.stream_set_user_attributes(self._ptr, value._ptr) _user_attributes = property( @@ -91,7 +98,7 @@ class _Stream(_StreamConst): ) def _name(self, name): - utils._check_str(name) + bt2_utils._check_str(name) native_bt.stream_set_name(self._ptr, name) _name = property(fget=_StreamConst.name.fget, fset=_name)