A reverse for parse_version (obviously without the dropped information).
(version)
| 34 | |
| 35 | |
| 36 | def format_version(version): |
| 37 | """A reverse for parse_version (obviously without the dropped information).""" |
| 38 | f = [] |
| 39 | it = iter(version) |
| 40 | while True: |
| 41 | part = next(it) |
| 42 | if part >= 0: |
| 43 | f.append(str(part)) |
| 44 | elif part == -1: |
| 45 | break |
| 46 | else: |
| 47 | f[-1] = f[-1] + {-2: "rc", -3: "b", -4: "a"}[part] + str(next(it)) |
| 48 | break |
| 49 | return ".".join(f) |
no outgoing calls