Sets the fields given at CLI or configuration to the specified values, for the singleton item.
(self, lib: library.Library)
| 763 | self.item.load() |
| 764 | |
| 765 | def set_fields(self, lib: library.Library) -> None: |
| 766 | """Sets the fields given at CLI or configuration to the specified |
| 767 | values, for the singleton item. |
| 768 | """ |
| 769 | for field, view in config["import"]["set_fields"].items(): |
| 770 | value = str(view.get()) |
| 771 | log.debug( |
| 772 | "Set field {}={} for {}", |
| 773 | field, |
| 774 | value, |
| 775 | util.displayable_path(self.paths), |
| 776 | ) |
| 777 | self.item.set_parse(field, format(self.item, value)) |
| 778 | self.item.store() |
| 779 | |
| 780 | |
| 781 | # FIXME The inheritance relationships are inverted. This is why there |