Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _set_as_key(self):
card_string = self['card_string']
res = _fitsio_wrap.parse_card(card_string)
if len(res) == 5:
keyclass, name, value, dtype, comment = res
else:
keyclass, name, dtype, comment = res
value = None
if keyclass == TYP_CONT_KEY:
raise ValueError("bad card '%s'. CONTINUE not "
"supported" % card_string)
self['class'] = keyclass
self['name'] = name
self['value_orig'] = value
self['value'] = self._convert_value(value)
self['dtype'] = dtype
self['comment'] = comment