Reverse of :func:`os.path.expanduser`
(path)
| 82 | |
| 83 | |
| 84 | def compress_user(path): |
| 85 | """Reverse of :func:`os.path.expanduser` |
| 86 | """ |
| 87 | home = os.path.expanduser('~') |
| 88 | if path.startswith(home): |
| 89 | path = "~" + path[len(home):] |
| 90 | return path |
| 91 | |
| 92 | def get_py_filename(name, force_win32=None): |
| 93 | """Return a valid python filename in the current directory. |