Returns directory path for a given filepath >>> directoryPath('/var/log/apache.log') '/var/log' >>> directoryPath('/var/log') '/var/log'
(filepath)
| 2093 | return asciiTbl |
| 2094 | |
| 2095 | def directoryPath(filepath): |
| 2096 | """ |
| 2097 | Returns directory path for a given filepath |
| 2098 | |
| 2099 | >>> directoryPath('/var/log/apache.log') |
| 2100 | '/var/log' |
| 2101 | >>> directoryPath('/var/log') |
| 2102 | '/var/log' |
| 2103 | """ |
| 2104 | |
| 2105 | retVal = filepath |
| 2106 | |
| 2107 | if filepath and os.path.splitext(filepath)[-1]: |
| 2108 | retVal = ntpath.dirname(filepath) if isWindowsDriveLetterPath(filepath) else posixpath.dirname(filepath) |
| 2109 | |
| 2110 | return retVal |
| 2111 | |
| 2112 | def normalizePath(filepath): |
| 2113 | """ |
no test coverage detected
searching dependent graphs…