Show More
@@ -93,10 +93,24 def _buildencodefun(): | |||
|
93 | 93 | pass |
|
94 | 94 | else: |
|
95 | 95 | raise KeyError |
|
96 |
return (lambda s: |
|
|
97 |
lambda s: |
|
|
96 | return (lambda s: ''.join([cmap[c] for c in s]), | |
|
97 | lambda s: ''.join(list(decode(s)))) | |
|
98 | ||
|
99 | _encodefname, _decodefname = _buildencodefun() | |
|
98 | 100 | |
|
99 | encodefilename, decodefilename = _buildencodefun() | |
|
101 | def encodefilename(s): | |
|
102 | ''' | |
|
103 | >>> encodefilename('foo.i/bar.d/bla.hg/hi:world?/HELLO') | |
|
104 | 'foo.i.hg/bar.d.hg/bla.hg.hg/hi~3aworld~3f/_h_e_l_l_o' | |
|
105 | ''' | |
|
106 | return _encodefname(encodedir(s)) | |
|
107 | ||
|
108 | def decodefilename(s): | |
|
109 | ''' | |
|
110 | >>> decodefilename('foo.i.hg/bar.d.hg/bla.hg.hg/hi~3aworld~3f/_h_e_l_l_o') | |
|
111 | 'foo.i/bar.d/bla.hg/hi:world?/HELLO' | |
|
112 | ''' | |
|
113 | return decodedir(_decodefname(s)) | |
|
100 | 114 | |
|
101 | 115 | def _buildlowerencodefun(): |
|
102 | 116 | ''' |
General Comments 0
You need to be logged in to leave comments.
Login now