/usr/lib/python3/dist-packages/librtmp/aval.py is in python3-librtmp 0.3.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | from . import ffi
from .compat import bytes, integer_types, string_types
__all__ = ["AVal"]
class AVal(object):
def __init__(self, value=None):
self.aval = ffi.new("AVal *")
if value is not None:
self.value = value
@property
def value(self):
buf = ffi.buffer(self.aval.av_val, self.aval.av_len)
return buf[:]
@value.setter
def value(self, value):
if isinstance(value, integer_types):
value = str(value)
if isinstance(value, string_types):
value = bytes(value, "utf8")
elif isinstance(value, bool):
value = str(value).lower()
self.value_str = ffi.new("char[]", value)
self.aval.av_val = self.value_str
self.aval.av_len = len(value)
|