(path)
| 593 | # 'a/b/c' points to directory, so does 'a/b/c/', but 'a/b/c.x' is parsed as a |
| 594 | # filename |
| 595 | def path_points_to_directory(path): |
| 596 | if path == '.': |
| 597 | return True |
| 598 | last_slash = max(path.rfind('/'), path.rfind('\\')) |
| 599 | last_dot = path.rfind('.') |
| 600 | no_suffix = last_dot < last_slash or last_dot == -1 |
| 601 | if no_suffix: |
| 602 | return True |
| 603 | suffix = path[last_dot:] |
| 604 | # Very simple logic for the only file suffixes used by emsdk downloader. Other |
| 605 | # suffixes, like 'clang-3.2' are treated as dirs. |
| 606 | if suffix in {'.exe', '.zip', '.txt'}: |
| 607 | return False |
| 608 | else: |
| 609 | return True |
| 610 | |
| 611 | |
| 612 | def get_content_length(download): |
no outgoing calls
no test coverage detected