MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / toggle_single

Method toggle_single

thirdparty/clientform/clientform.py:1950–1965  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 3

_set_selected_stateMethod · 0.95
deprecationFunction · 0.85
ItemCountErrorClass · 0.85

Tested by

no test coverage detected