(text)
| 415 | |
| 416 | |
| 417 | def SortBySpec(text): |
| 418 | from ..manifest import AI_HUMAN_SORT_KEYS |
| 419 | |
| 420 | for sort_key in text.split(","): |
| 421 | if sort_key not in AI_HUMAN_SORT_KEYS and sort_key != "ts": # idempotency: do not reject ts |
| 422 | raise ArgumentTypeError("Invalid sort key: %s" % sort_key) |
| 423 | return text.replace("timestamp", "ts").replace("archive", "name") |
| 424 | |
| 425 | |
| 426 | def format_file_size(v, precision=2, sign=False, iec=False): |