Unparse a keyword spec dictionary into a string.
(name, spec)
| 377 | |
| 378 | |
| 379 | def unparse_spec(name, spec): |
| 380 | """Unparse a keyword spec dictionary into a string.""" |
| 381 | if spec == {'msgid': 0}: |
| 382 | return name |
| 383 | |
| 384 | parts = [] |
| 385 | for arg, pos in sorted(spec.items(), key=lambda x: x[1]): |
| 386 | if arg == 'msgctxt': |
| 387 | parts.append(f'{pos + 1}c') |
| 388 | else: |
| 389 | parts.append(str(pos + 1)) |
| 390 | return f'{name}:{','.join(parts)}' |
| 391 | |
| 392 | |
| 393 | def process_keywords(keywords, *, no_default_keywords): |
searching dependent graphs…