Deprecated: toggle the selection of the single item in this control. Raises ItemCountError if the control does not contain only one item. by_label argument is ignored, and included only for backwards compatibility.
(self, by_label=None)
| 1948 | item.__dict__["_selected"] = True |
| 1949 | |
| 1950 | def toggle_single(self, by_label=None): |
| 1951 | """Deprecated: toggle the selection of the single item in this control. |
| 1952 | |
| 1953 | Raises ItemCountError if the control does not contain only one item. |
| 1954 | |
| 1955 | by_label argument is ignored, and included only for backwards |
| 1956 | compatibility. |
| 1957 | |
| 1958 | """ |
| 1959 | deprecation( |
| 1960 | "control.items[0].selected = not control.items[0].selected") |
| 1961 | if len(self.items) != 1: |
| 1962 | raise ItemCountError( |
| 1963 | "'%s' is not a single-item control" % self.name) |
| 1964 | item = self.items[0] |
| 1965 | self._set_selected_state(item, not item.selected) |
| 1966 | |
| 1967 | def set_single(self, selected, by_label=None): |
| 1968 | """Deprecated: set the selection of the single item in this control. |
nothing calls this directly
no test coverage detected