A token for ``ByteOrderedPartitioner``.
| 1868 | |
| 1869 | |
| 1870 | class BytesToken(Token): |
| 1871 | """ |
| 1872 | A token for ``ByteOrderedPartitioner``. |
| 1873 | """ |
| 1874 | |
| 1875 | @classmethod |
| 1876 | def from_string(cls, token_string): |
| 1877 | """ `token_string` should be the string representation from the server. """ |
| 1878 | # unhexlify works fine with unicode input in everythin but pypy3, where it Raises "TypeError: 'str' does not support the buffer interface" |
| 1879 | if isinstance(token_string, str): |
| 1880 | token_string = token_string.encode('ascii') |
| 1881 | # The BOP stores a hex string |
| 1882 | return cls(unhexlify(token_string)) |
| 1883 | |
| 1884 | |
| 1885 | class TriggerMetadata(object): |
no outgoing calls