Return True if all the paths have the same leading path name (i.e., everything is in one subdirectory in an archive).
(self, paths)
| 127 | return path, "" |
| 128 | |
| 129 | def has_leading_dir(self, paths): |
| 130 | """ |
| 131 | Return True if all the paths have the same leading path name |
| 132 | (i.e., everything is in one subdirectory in an archive). |
| 133 | """ |
| 134 | common_prefix = None |
| 135 | for path in paths: |
| 136 | prefix, rest = self.split_leading_dir(path) |
| 137 | if not prefix: |
| 138 | return False |
| 139 | elif common_prefix is None: |
| 140 | common_prefix = prefix |
| 141 | elif prefix != common_prefix: |
| 142 | return False |
| 143 | return True |
| 144 | |
| 145 | def target_filename(self, to_path, name): |
| 146 | target_path = os.path.abspath(to_path) |
no test coverage detected