WasatchPhotonics / ENLIGHTEN

Open-source spectroscopy application for controlling and taking measurements from Wasatch Photonics spectrometers.
https://wasatchphotonics.com/product-category/software/
MIT License
3 stars 6 forks source link

Use of undefined field on Ln 209 of ui/ThumbnailWidget #221

Closed samiebee43 closed 7 months ago

samiebee43 commented 1 year ago

Use of undefined field on 209. This if statement either shorts on the first operand of AND or just doesn't get called. The undefined token should be removed.

The whole section with ok=... followed by return ok is based on an outdated representation of common.Views.

The function should just return True here.

# things get weird for loaded Measurements
ok = self.view is None or \
     (isinstance(self.view, common.Views) and self.view == common.Views.RAMAN) or \
     "raman" in str(self.view).lower()
log.debug("should_add_id = %s (self.view %s)", ok, self.view)
return ok

becomes

log.debug("should_add_id = %s (self.view %s)", True, self.view)
return True

_Originally posted by @samiebee43 in https://github.com/WasatchPhotonics/ENLIGHTEN/pull/216#discussion_r1251297393_

mzieg commented 7 months ago

Don't know what this was, but definitely OBE now