Show More
@@ -41,3 +41,11 b' def encodekeys(keys):' | |||||
41 | """encode the content of a pushkey namespace for exchange over the wire""" |
|
41 | """encode the content of a pushkey namespace for exchange over the wire""" | |
42 | enc = encoding.fromlocal |
|
42 | enc = encoding.fromlocal | |
43 | return '\n'.join(['%s\t%s' % (enc(k), enc(v)) for k, v in keys]) |
|
43 | return '\n'.join(['%s\t%s' % (enc(k), enc(v)) for k, v in keys]) | |
|
44 | ||||
|
45 | def decodekeys(data): | |||
|
46 | """decode the content of a pushkey namespace from exchange over the wire""" | |||
|
47 | result = {} | |||
|
48 | for l in data.splitlines(): | |||
|
49 | k, v = l.split('\t') | |||
|
50 | result[encoding.tolocal(k)] = encoding.tolocal(v) | |||
|
51 | return result |
General Comments 0
You need to be logged in to leave comments.
Login now