earl / beanstalkc

A simple beanstalkd client library for Python
Apache License 2.0
458 stars 115 forks source link

beanstalk.tubes() returns string instead of list #28

Closed brejoc closed 11 years ago

brejoc commented 11 years ago

The tutorial shows that the tubes method returns a list of values. But the current master returns a string with line breaks, probably meant for printing.

>>> beanstalk.tubes()
'---\n- default\n- foo\n'
brejoc commented 11 years ago

If just noticed, that the same applies to the stats method for jobs. Are you redesigning this? From my point of view I would prefer dicts and lists instead of raw strings.

>>> job.stats()
'---\nid: 4\ntube: default\nstate: ready\npri: 2147483648\nage: 1221\ndelay: 0\nttr: 120\ntime-left: 0\nfile: 0\nreserves: 1\ntimeouts: 1\nreleases: 0\nburies: 0\nkicks: 0\n'
earl commented 11 years ago

beanstalkc requires PyYAML to parse the stats output. Unless you explicitly disable YAML parsing, a warning message should have been logged when you construct a Connection with YAML not available. See Appendix A of the tutorial for details.

brejoc commented 11 years ago

Woops, seems like I did skip that part. Works now. Thanks!