MCPcopy Create free account
hub / github.com/ipython/ipython / compress_user

Function compress_user

IPython/utils/path.py:84–90  ·  view source on GitHub ↗

Reverse of :func:`os.path.expanduser`

(path)

Source from the content-addressed store, hash-verified

82
83
84def 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
92def get_py_filename(name, force_win32=None):
93 """Return a valid python filename in the current directory.

Callers 4

load_extensionMethod · 0.90
_infoMethod · 0.90
test_infoFunction · 0.90
reportFunction · 0.90

Calls

no outgoing calls

Tested by 2

test_infoFunction · 0.72
reportFunction · 0.72