提交 fa1d1938 编写于 作者: M Mort Yao

common: remove deprecated, unused function filenameable()

上级 ba861d4c
......@@ -111,38 +111,6 @@ def escape_file_path(path):
path = path.replace('?', '-')
return path
# DEPRECATED in favor of util.legitimize()
def filenameable(text):
"""Converts a string to a legal filename through various OSes.
"""
# All POSIX systems
text = text.translate({
0: None,
ord('/'): '-',
})
if platform.system() == 'Windows': # For Windows
text = text.translate({
ord(':'): '-',
ord('*'): '-',
ord('?'): '-',
ord('\\'): '-',
ord('\"'): '\'',
ord('<'): '-',
ord('>'): '-',
ord('|'): '-',
ord('+'): '-',
ord('['): '(',
ord(']'): ')',
})
else:
if text.startswith("."):
text = text[1:]
if platform.system() == 'Darwin': # For Mac OS
text = text.translate({
ord(':'): '-',
})
return text
def ungzip(data):
"""Decompresses data for Content-Encoding: gzip.
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册