Skip to content
Snippets Groups Projects
Commit a3198425 authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

pushkey: add a ``decode`` function

This function is just a shorthand for ``decoding.fromlocal``. It will help
hiding the encoding business from other code exchanging pushkey data over the
wire.
parent 0696ca0a
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,8 @@
lk = _get(namespace)[1]
return lk(repo)
decode = encoding.tolocal
def encodekeys(keys):
"""encode the content of a pushkey namespace for exchange over the wire"""
enc = encoding.fromlocal
......@@ -47,5 +49,5 @@
result = {}
for l in data.splitlines():
k, v = l.split('\t')
result[encoding.tolocal(k)] = encoding.tolocal(v)
result[decode(k)] = decode(v)
return result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment