def download(self, options):
        """ download the schema """
        url = self.location
        try:
            if '://' not in url:
                url = urljoin(self.schema.baseurl, url)
            reader = DocumentReader(options)
            d = reader.open(url)
            root = d.root()
            root.set('url', url)
            self.__applytns(root)
            return self.schema.instance(root, url, options)
        except TransportError:
            msg = 'include schema at (%s), failed' % url
            log.error('%s, %s', self.id, msg, exc_info=True)
            raise Exception(msg)
def download ( self , options ) : url = self . location try : if '://' not in url : url = urljoin ( self . schema . baseurl , url ) reader = DocumentReader ( options ) d = reader . open ( url ) root = d . root ( ) root . set ( 'url' , url ) self . __applytns ( root ) return self . schema . instance ( root , url , options ) except TransportError : msg = 'include schema at (%s), failed' % url log . error ( '%s, %s' , self . id , msg , exc_info = True ) raise Exception ( msg )
download the schema