Removes segments. Positive values shave the first segments, negative shave the last segments.
(path, n_shave_prefix_segments=1)
| 89 | |
| 90 | |
| 91 | def shave_segments(path, n_shave_prefix_segments=1): |
| 92 | """ |
| 93 | Removes segments. Positive values shave the first segments, negative shave the last segments. |
| 94 | """ |
| 95 | if n_shave_prefix_segments >= 0: |
| 96 | return ".".join(path.split(".")[n_shave_prefix_segments:]) |
| 97 | else: |
| 98 | return ".".join(path.split(".")[:n_shave_prefix_segments]) |
| 99 | |
| 100 | |
| 101 | def renew_temp_conv_paths(old_list, n_shave_prefix_segments=0): |
no test coverage detected
searching dependent graphs…