Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get(self, k, default=None): return self.__getitem__(k, default)
def __contains__(self, k): return self._get(k) is not None
def _c_val(self, c_val, default=KeyError):
v = self._c_vals.get(c_val)
if v is not None: return v
if default is not KeyError:
return EnumValue(self._name, default, c_val)
raise KeyError(c_val)
def __repr__(self):
return ''.format(self._name, ' '.join(sorted(self._values.keys())))
PulseEventTypeEnum = Enum('event-type', c.PA_EVENT_TYPE_MAP)
PulseEventFacilityEnum = Enum('event-facility', c.PA_EVENT_FACILITY_MAP)
PulseEventMaskEnum = Enum('event-mask', c.PA_EVENT_MASK_MAP)
PulseStateEnum = Enum('sink/source-state', c.PA_OBJ_STATE_MAP)
PulseUpdateEnum = Enum('update-type', c.PA_UPDATE_MAP)
PulsePortAvailableEnum = Enum('available', c.PA_PORT_AVAILABLE_MAP)
PulseDirectionEnum = Enum('direction', c.PA_DIRECTION_MAP)
class PulseError(Exception): pass
class PulseOperationFailed(PulseError): pass
class PulseOperationInvalid(PulseOperationFailed): pass
class PulseIndexError(PulseError): pass
class PulseLoopStop(Exception): pass
class PulseDisconnected(Exception): pass
def _c_val(self, c_val, default=KeyError):
v = self._c_vals.get(c_val)
if v is not None: return v
if default is not KeyError:
return EnumValue(self._name, default, c_val)
raise KeyError(c_val)
def __repr__(self):
return ''.format(self._name, ' '.join(sorted(self._values.keys())))
PulseEventTypeEnum = Enum('event-type', c.PA_EVENT_TYPE_MAP)
PulseEventFacilityEnum = Enum('event-facility', c.PA_EVENT_FACILITY_MAP)
PulseEventMaskEnum = Enum('event-mask', c.PA_EVENT_MASK_MAP)
PulseStateEnum = Enum('sink/source-state', c.PA_OBJ_STATE_MAP)
PulseUpdateEnum = Enum('update-type', c.PA_UPDATE_MAP)
PulsePortAvailableEnum = Enum('available', c.PA_PORT_AVAILABLE_MAP)
PulseDirectionEnum = Enum('direction', c.PA_DIRECTION_MAP)
class PulseError(Exception): pass
class PulseOperationFailed(PulseError): pass
class PulseOperationInvalid(PulseOperationFailed): pass
class PulseIndexError(PulseError): pass
class PulseLoopStop(Exception): pass
class PulseDisconnected(Exception): pass
class PulseObject(object):
c_struct_wrappers = dict()
def __contains__(self, k): return self._get(k) is not None
def _c_val(self, c_val, default=KeyError):
v = self._c_vals.get(c_val)
if v is not None: return v
if default is not KeyError:
return EnumValue(self._name, default, c_val)
raise KeyError(c_val)
def __repr__(self):
return ''.format(self._name, ' '.join(sorted(self._values.keys())))
PulseEventTypeEnum = Enum('event-type', c.PA_EVENT_TYPE_MAP)
PulseEventFacilityEnum = Enum('event-facility', c.PA_EVENT_FACILITY_MAP)
PulseEventMaskEnum = Enum('event-mask', c.PA_EVENT_MASK_MAP)
PulseStateEnum = Enum('sink/source-state', c.PA_OBJ_STATE_MAP)
PulseUpdateEnum = Enum('update-type', c.PA_UPDATE_MAP)
PulsePortAvailableEnum = Enum('available', c.PA_PORT_AVAILABLE_MAP)
PulseDirectionEnum = Enum('direction', c.PA_DIRECTION_MAP)
class PulseError(Exception): pass
class PulseOperationFailed(PulseError): pass
class PulseOperationInvalid(PulseOperationFailed): pass
class PulseIndexError(PulseError): pass
class PulseLoopStop(Exception): pass
class PulseDisconnected(Exception): pass
class PulseObject(object):
def _get(self, k, default=None): return self.__getitem__(k, default)
def __contains__(self, k): return self._get(k) is not None
def _c_val(self, c_val, default=KeyError):
v = self._c_vals.get(c_val)
if v is not None: return v
if default is not KeyError:
return EnumValue(self._name, default, c_val)
raise KeyError(c_val)
def __repr__(self):
return ''.format(self._name, ' '.join(sorted(self._values.keys())))
PulseEventTypeEnum = Enum('event-type', c.PA_EVENT_TYPE_MAP)
PulseEventFacilityEnum = Enum('event-facility', c.PA_EVENT_FACILITY_MAP)
PulseEventMaskEnum = Enum('event-mask', c.PA_EVENT_MASK_MAP)
PulseStateEnum = Enum('sink/source-state', c.PA_OBJ_STATE_MAP)
PulseUpdateEnum = Enum('update-type', c.PA_UPDATE_MAP)
PulsePortAvailableEnum = Enum('available', c.PA_PORT_AVAILABLE_MAP)
PulseDirectionEnum = Enum('direction', c.PA_DIRECTION_MAP)
class PulseError(Exception): pass
class PulseOperationFailed(PulseError): pass
class PulseOperationInvalid(PulseOperationFailed): pass
class PulseIndexError(PulseError): pass
class PulseLoopStop(Exception): pass
class PulseDisconnected(Exception): pass
if v is not None: return v
if default is not KeyError:
return EnumValue(self._name, default, c_val)
raise KeyError(c_val)
def __repr__(self):
return ''.format(self._name, ' '.join(sorted(self._values.keys())))
PulseEventTypeEnum = Enum('event-type', c.PA_EVENT_TYPE_MAP)
PulseEventFacilityEnum = Enum('event-facility', c.PA_EVENT_FACILITY_MAP)
PulseEventMaskEnum = Enum('event-mask', c.PA_EVENT_MASK_MAP)
PulseStateEnum = Enum('sink/source-state', c.PA_OBJ_STATE_MAP)
PulseUpdateEnum = Enum('update-type', c.PA_UPDATE_MAP)
PulsePortAvailableEnum = Enum('available', c.PA_PORT_AVAILABLE_MAP)
PulseDirectionEnum = Enum('direction', c.PA_DIRECTION_MAP)
class PulseError(Exception): pass
class PulseOperationFailed(PulseError): pass
class PulseOperationInvalid(PulseOperationFailed): pass
class PulseIndexError(PulseError): pass
class PulseLoopStop(Exception): pass
class PulseDisconnected(Exception): pass
class PulseObject(object):
c_struct_wrappers = dict()
def __init__(self, struct=None, *field_data_list, **field_data_dict):
v = self._c_vals.get(c_val)
if v is not None: return v
if default is not KeyError:
return EnumValue(self._name, default, c_val)
raise KeyError(c_val)
def __repr__(self):
return ''.format(self._name, ' '.join(sorted(self._values.keys())))
PulseEventTypeEnum = Enum('event-type', c.PA_EVENT_TYPE_MAP)
PulseEventFacilityEnum = Enum('event-facility', c.PA_EVENT_FACILITY_MAP)
PulseEventMaskEnum = Enum('event-mask', c.PA_EVENT_MASK_MAP)
PulseStateEnum = Enum('sink/source-state', c.PA_OBJ_STATE_MAP)
PulseUpdateEnum = Enum('update-type', c.PA_UPDATE_MAP)
PulsePortAvailableEnum = Enum('available', c.PA_PORT_AVAILABLE_MAP)
PulseDirectionEnum = Enum('direction', c.PA_DIRECTION_MAP)
class PulseError(Exception): pass
class PulseOperationFailed(PulseError): pass
class PulseOperationInvalid(PulseOperationFailed): pass
class PulseIndexError(PulseError): pass
class PulseLoopStop(Exception): pass
class PulseDisconnected(Exception): pass
class PulseObject(object):
c_struct_wrappers = dict()
if default is not KeyError:
return EnumValue(self._name, default, c_val)
raise KeyError(c_val)
def __repr__(self):
return ''.format(self._name, ' '.join(sorted(self._values.keys())))
PulseEventTypeEnum = Enum('event-type', c.PA_EVENT_TYPE_MAP)
PulseEventFacilityEnum = Enum('event-facility', c.PA_EVENT_FACILITY_MAP)
PulseEventMaskEnum = Enum('event-mask', c.PA_EVENT_MASK_MAP)
PulseStateEnum = Enum('sink/source-state', c.PA_OBJ_STATE_MAP)
PulseUpdateEnum = Enum('update-type', c.PA_UPDATE_MAP)
PulsePortAvailableEnum = Enum('available', c.PA_PORT_AVAILABLE_MAP)
PulseDirectionEnum = Enum('direction', c.PA_DIRECTION_MAP)
class PulseError(Exception): pass
class PulseOperationFailed(PulseError): pass
class PulseOperationInvalid(PulseOperationFailed): pass
class PulseIndexError(PulseError): pass
class PulseLoopStop(Exception): pass
class PulseDisconnected(Exception): pass
class PulseObject(object):
c_struct_wrappers = dict()
def __init__(self, struct=None, *field_data_list, **field_data_dict):
field_data, fields = dict(), getattr(self, 'c_struct_fields', list())