glymur/jp2box.py
def _validate(self, writing=False):
        """
        Validate the box before writing to file.
        """
        if self.brand not in ['jp2 ', 'jpx ']:
            msg = (
                f"The file type brand was '{self.brand}'.  "
                f"It should be either 'jp2 ' or 'jpx '."
            )
            if writing:
                raise InvalidJp2kError(msg)
            else:
                warnings.warn(msg, UserWarning)
        for item in self.compatibility_list:
            if item not in self._valid_cls:
                msg = (
                    f"The file type compatibility list "
                    f"{self.compatibility_list} is not valid.  All items "
                    f"should be members of {self._valid_cls}."
                )
                if writing:
                    raise InvalidJp2kError(msg)
                else:
                    warnings.warn(msg, UserWarning)

        Validate the box before writing to file.
        
Validate the box before writing to file.
Validate the box before writing to file .
def _validate(self, writing=False):
        if self.brand not in ['jp2 ', 'jpx ']:
            msg = (
                f"The file type brand was '{self.brand}'.  "
                f"It should be either 'jp2 ' or 'jpx '."
            )
            if writing:
                raise InvalidJp2kError(msg)
            else:
                warnings.warn(msg, UserWarning)
        for item in self.compatibility_list:
            if item not in self._valid_cls:
                msg = (
                    f"The file type compatibility list "
                    f"{self.compatibility_list} is not valid.  All items "
                    f"should be members of {self._valid_cls}."
                )
                if writing:
                    raise InvalidJp2kError(msg)
                else:
                    warnings.warn(msg, UserWarning)
def _validate ( self , writing = False ) : if self . brand not in [ 'jp2 ' , 'jpx ' ] : msg = ( f"The file type brand was '{self.brand}'.  " f"It should be either 'jp2 ' or 'jpx '." ) if writing : raise InvalidJp2kError ( msg ) else : warnings . warn ( msg , UserWarning ) for item in self . compatibility_list : if item not in self . _valid_cls : msg = ( f"The file type compatibility list " f"{self.compatibility_list} is not valid.  All items " f"should be members of {self._valid_cls}." ) if writing : raise InvalidJp2kError ( msg ) else : warnings . warn ( msg , UserWarning )
Validate the box before writing to file.
Validate the box before writing to file .
"""
        Validate the box before writing to file.
        """
self
writing