(vm: &VirtualMachine)
| 738 | |
| 739 | #[pyattr] |
| 740 | fn _xoptions(vm: &VirtualMachine) -> PyDictRef { |
| 741 | let ctx = &vm.ctx; |
| 742 | let xopts = ctx.new_dict(); |
| 743 | for (key, value) in &vm.state.config.settings.xoptions { |
| 744 | let value = value.as_ref().map_or_else( |
| 745 | || ctx.new_bool(true).into(), |
| 746 | |s| ctx.new_str(s.clone()).into(), |
| 747 | ); |
| 748 | xopts.set_item(&**key, value, vm).unwrap(); |
| 749 | } |
| 750 | xopts |
| 751 | } |
| 752 | |
| 753 | #[pyattr] |
| 754 | fn warnoptions(vm: &VirtualMachine) -> Vec<PyObjectRef> { |