mk-fg / python-pulse-control

Python high-level interface and ctypes-based bindings for PulseAudio (libpulse)
https://pypi.org/project/pulsectl/
MIT License
170 stars 36 forks source link

Documentation bug: event example code TypeErrors #16

Closed lf- closed 7 years ago

lf- commented 7 years ago
~ » python3.6 patest.py
Traceback (most recent call last):
  File "patest.py", line 10, in <module>
    print('Event types:', ', '.join(p.event_types))
TypeError: sequence item 0: expected str instance, EnumValue found

File contents:

import pulsectl

def event_cb(evt):
    print(evt)
    print(dir(evt))

with pulsectl.Pulse('test1') as p:
    print('Event types:', ', '.join(p.event_types))
    print('Event facilities:', ', '.join(p.event_facilities))
    print('Event masks:', ', '.join(p.event_masks))
mk-fg commented 7 years ago

Right, forgot to update these when changed strings to enum values. Thanks for reporting, should be fixed in 517429f.

mk-fg commented 7 years ago

Or rather 79b5f9e, as that I'm not sure what that str.join is even doing there :)