X-Git-Url: http://git.kaliko.me/?p=python-musicpd.git;a=blobdiff_plain;f=README.rst;fp=README.rst;h=ca91f0eaaaeb5517172b30a5246f117839ef92fb;hp=2bd88dce0ac714c31bee7c2fbfd5befcbaec3732;hb=b4809c9b9381ab02fc3d439005e5b6d89d32e5a2;hpb=e8daa719b31e6728f697fdc2812d969038ebe159 diff --git a/README.rst b/README.rst index 2bd88dc..ca91f0e 100644 --- a/README.rst +++ b/README.rst @@ -54,6 +54,16 @@ Command lists are also supported using `command_list_ok_begin()` and client.status() # insert the status command into the list results = client.command_list_end() # results will be a list with the results +Provide a 2-tuple as argument for command supporting ranges (cf. `MPD protocol documentation`_ for more details):: + + # An intelligent clear + # clears played track in the queue, currentsong included + pos = client.currentsong().get('pos', 0) + # the 2-tuple range object accepts str, no need to convert to int + client.delete((0, pos)) + # missing end interpreted as highest value possible, pay attention still need a tuple. + client.delete((pos,)) # purge queue from current to the end + Commands may also return iterators instead of lists if `iterate` is set to `True`::