def _check_version(self, tree): """Returns true of the instance document @tree is a version supported by python-stix. """ document_version = get_document_version(tree) supported = stix.supported_stix_version() if StrictVersion(supported) == StrictVersion(document_version): return error = ( "Your python-stix library supports STIX %s. Document version was " "%s" % (supported, document_version) ) raise UnsupportedVersionError( message=error, expected=supported, found=document_version )
def _check_version(self, tree): """Returns true of the instance document @tree is a version supported by python-stix. """ document_version = get_document_version(tree) supported = stix.supported_stix_version() sv_doc_version = StrictVersion(document_version) sv_api_versions = [StrictVersion(x) for x in supported] if sv_doc_version in sv_api_versions: return error = ( "Your python-stix library supports STIX versions: %s. Document " "version was %s" % (supported, document_version) ) raise UnsupportedVersionError( message=error, expected=supported, found=document_version )
def supported_versions(self, tag=TAG_STIX_PACKAGE): return stix.supported_stix_version()