MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / _validate_id_uid

Method _validate_id_uid

pyxrf/gui_module/dlg_select_scan.py:116–133  ·  view source on GitHub ↗
(self, text=None)

Source from the content-addressed store, hash-verified

114 return self._mode_id_uid, self._id_uid
115
116 def _validate_id_uid(self, text=None):
117 valid = False
118 if text is None:
119 text = self.le_id_uid.text()
120 if self._mode_id_uid == "id":
121 if self._validator_id.validate(text, 0)[0] == QIntValidator.Acceptable:
122 valid = True
123 elif self._mode_id_uid == "uid":
124 if (
125 self._validator_uid_short.validate(text, 0)[0] == QIntValidator.Acceptable
126 or self._validator_uid_full.validate(text, 0)[0] == QIntValidator.Acceptable
127 ):
128 valid = True
129
130 self.le_id_uid.setValid(valid)
131 self.pb_ok.setEnabled(valid)
132
133 return valid
134
135 def _read_id_uid(self, text):
136 # It is assumed that the entered text is valid for the selected mode

Callers 4

__init__Method · 0.95

Calls 2

setValidMethod · 0.80
validateMethod · 0.45

Tested by

no test coverage detected