Convert sys.path into a list of absolute, existing, unique paths.
()
| 118 | # --------------------------------------------------------- common routines |
| 119 | |
| 120 | def pathdirs(): |
| 121 | """Convert sys.path into a list of absolute, existing, unique paths.""" |
| 122 | dirs = [] |
| 123 | normdirs = [] |
| 124 | for dir in sys.path: |
| 125 | dir = os.path.abspath(dir or '.') |
| 126 | normdir = os.path.normcase(dir) |
| 127 | if normdir not in normdirs and os.path.isdir(dir): |
| 128 | dirs.append(dir) |
| 129 | normdirs.append(normdir) |
| 130 | return dirs |
| 131 | |
| 132 | def _getdoc(object): |
| 133 | return inspect.getdoc(object, |