Read the flags from a dictionary and return them in a usable form. Will return a list of (flag, value) for all flags in "flag_dict" matching the filter "flag_filter".
(flag_dict, flag_filter)
| 685 | |
| 686 | |
| 687 | def retrieve_flags(flag_dict, flag_filter): |
| 688 | """Read the flags from a dictionary and return them in a usable form. |
| 689 | |
| 690 | Will return a list of (flag, value) for all flags in "flag_dict" |
| 691 | matching the filter "flag_filter". |
| 692 | """ |
| 693 | |
| 694 | return [ |
| 695 | (flag, flag_dict[flag]) |
| 696 | for flag in flag_dict.keys() |
| 697 | if isinstance(flag, (str, bytes)) and flag.startswith(flag_filter) |
| 698 | ] |
| 699 | |
| 700 | |
| 701 | def set_flags(obj, flag_field, flags): |
no test coverage detected