mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-18 02:40:07 +00:00
10 lines
228 B
Python
10 lines
228 B
Python
|
|
import re
|
|
|
|
|
|
def path2magic(path):
|
|
return re.sub(ur'[/@]', lambda m: {u'/': u'@_', u'@': u'@@'}[m.group(0)], path)
|
|
|
|
def magic2path(path):
|
|
return re.sub(ur'@[_@]', lambda m: {u'@_': u'/', u'@@': u'@'}[m.group(0)], path)
|