You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
364 B
15 lines
364 B
#!/usr/bin/env python
|
|
|
|
|
|
def multivalue_encode(value):
|
|
"""
|
|
Encode a value as part of a multivalue field expected by the Chunked External Command Protocol
|
|
|
|
Args:
|
|
value (str): the value to encode
|
|
|
|
Returns:
|
|
(str): encoded value with $ in the beginning and end. Also $$ for single $.
|
|
"""
|
|
return '$%s$' % value.replace('$', '$$')
|