loop: add autoclear propert to LoopInfo
Small convenience property to check if the autoclear flag is set in the `lo_flags` member of the `LoopInfo`. Also add a corresponding test for it.
This commit is contained in:
parent
62082733e9
commit
61d5f15420
2 changed files with 13 additions and 1 deletions
|
|
@ -38,6 +38,11 @@ class LoopInfo(ctypes.Structure):
|
|||
('lo_init', ctypes.c_uint64 * 2)
|
||||
]
|
||||
|
||||
@property
|
||||
def autoclear(self) -> bool:
|
||||
"""Return if `LO_FLAGS_AUTOCLEAR` is set in `lo_flags`"""
|
||||
return bool(self.lo_flags & Loop.LO_FLAGS_AUTOCLEAR)
|
||||
|
||||
|
||||
class Loop:
|
||||
"""Loopback device
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue