(name)
| 28 | """ |
| 29 | |
| 30 | def _convert_name(name): |
| 31 | # on Linux / Mac OS X 'foo.PY' is not importable, but on |
| 32 | # Windows it is. Simpler to do a case insensitive match |
| 33 | # a better check would be to check that the name is a |
| 34 | # valid Python module name. |
| 35 | if os.path.isfile(name) and name.lower().endswith('.py'): |
| 36 | if os.path.isabs(name): |
| 37 | rel_path = os.path.relpath(name, os.getcwd()) |
| 38 | if os.path.isabs(rel_path) or rel_path.startswith(os.pardir): |
| 39 | return name |
| 40 | name = rel_path |
| 41 | # on Windows both '\' and '/' are used as path |
| 42 | # separators. Better to replace both than rely on os.path.sep |
| 43 | return os.path.normpath(name)[:-3].replace('\\', '.').replace('/', '.') |
| 44 | return name |
| 45 | |
| 46 | def _convert_names(names): |
| 47 | return [_convert_name(name) for name in names] |
no test coverage detected
searching dependent graphs…