| |
- abbrev_path(path=None)
- Abbreviate a full path (or the current path, if None is provided) to make
it shorter, yet still unambiguous.
This function takes a directory path and tries to abbreviate it as much as
possible while making sure that the resulting shortened path is not
ambiguous: a path element is only abbreviated if its shortened form is
unique in its directory (in other words, if a sybling would have the same
abbreviation, the original name is kept).
The abbreviation is performed by keeping only the first letter of each
"word" composing a path element. "Words" are defined by CamelCase,
underscore_separation or "whitespace separation".
- abbrev_path_prompt()
- Return a prompt containg the current path (abbreviated)
This is the default PyCmd prompt. It uses the abbrev_path() function to
obtain the shortened path and appends the typical '> '.
|