Join two or more pathname components + - convert a /-separated pathname to one using the OS's path separator. - resolve `..` and `.` from path. Either passing n arguments as in njoin('a','b'), or a sequence of n names as in njoin(['a','b']) is handled, or a mixture of such arguments
(*path)
| 176 | return d or '.' |
| 177 | |
| 178 | def njoin(*path): |
| 179 | """Join two or more pathname components + |
| 180 | - convert a /-separated pathname to one using the OS's path separator. |
| 181 | - resolve `..` and `.` from path. |
| 182 | |
| 183 | Either passing n arguments as in njoin('a','b'), or a sequence |
| 184 | of n names as in njoin(['a','b']) is handled, or a mixture of such arguments. |
| 185 | """ |
| 186 | paths = [] |
| 187 | for p in path: |
| 188 | if is_sequence(p): |
| 189 | # njoin(['a', 'b'], 'c') |
| 190 | paths.append(njoin(*p)) |
| 191 | else: |
| 192 | assert is_string(p) |
| 193 | paths.append(p) |
| 194 | path = paths |
| 195 | if not path: |
| 196 | # njoin() |
| 197 | joined = '' |
| 198 | else: |
| 199 | # njoin('a', 'b') |
| 200 | joined = os.path.join(*path) |
| 201 | if os.path.sep != '/': |
| 202 | joined = joined.replace('/', os.path.sep) |
| 203 | return minrelpath(joined) |
| 204 | |
| 205 | def get_mathlibs(path=None): |
| 206 | """Return the MATHLIB line from numpyconfig.h |
no test coverage detected