lericson/pylibmc — pull request #76 by jhansche (2012-02-15 22:38:44+00:00)
Title: Support for weights on servers

The current server list parsing is lacking the ability to specify a weight for individual servers in the pool. The `memcached_servers_parse()` function in libmemcached does support the format "`addr:port:weight`" for TCP servers, however, pylibmc does not accept that format (additionally `memcached_servers_parse()` is [documented] as "DEPRECATED").

This change adds support for the `addr:port:weight` format, and also allows passing the weight explicitly to `translate_server_spec()`, and adding weight into the server list tuple.

Unit tests have been updated to reflect the changes.

[documented]: http://docs.libmemcached.org/memcached_server_st.html