(self, by_label=None)
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.
Deprecated: toggle the selection of the single item in this control.
Deprecated : toggle the selection of the single item in this control .
def toggle_single(self, by_label=None):
        """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.

        """
        deprecation(
            "control.items[0].selected = not control.items[0].selected")
        if len(self.items) != 1:
            raise ItemCountError(
                "'%s' is not a single-item control" % self.name)
        item = self.items[0]
        self._set_selected_state(item, not item.selected)
def toggle_single ( self , by_label = None ) : deprecation ( "control.items[0].selected = not control.items[0].selected" ) if len ( self . items ) != 1 : raise ItemCountError ( "'%s' is not a single-item control" % self . name ) item = self . items [ 0 ] self . _set_selected_state ( item , not item . selected )