ieml/dictionary/version.py
def load(self):
        """
        Download the dictionary version and cache the retrieved file.
        :return: None
        """
        if self.loaded:
            return

        file_name = "%s.json" % str(self)
        file = os.path.join(VERSIONS_FOLDER, file_name)

        if not os.path.isfile(file):
            DICTIONARY_BUCKET_URL = get_configuration().get('VERSIONS', 'versionsurl')
            url = urllib.parse.urljoin(DICTIONARY_BUCKET_URL, file_name)
            logger.log(logging.INFO, "Downloading dictionary %s at %s" % (file_name, url))

            urlretrieve(url, file)

        with open(file, 'r') as fp:
            self.__setstate__(json.load(fp))
def load(self):
        """
        Download the dictionary version and cache the retrieved file.
        :return: None
        """
        if self.loaded:
            return

        file_name = "%s.json" % str(self)
        file = os.path.join(VERSIONS_FOLDER, file_name)

        if not os.path.isfile(file):
            DICTIONARY_BUCKET_URL = get_configuration().get('VERSIONS', 'versionsurl')
            url = urllib.parse.urljoin(DICTIONARY_BUCKET_URL, file_name)
            logger.log(logging.INFO, "Downloading dictionary %s at %s" % (file_name, url))

            urlretrieve(url, file)

        with open(file, 'r') as fp:
            self.__setstate__(json.load(fp))
def load ( self ) : if self . loaded : return file_name = "%s.json" % str ( self ) file = os . path . join ( VERSIONS_FOLDER , file_name ) if not os . path . isfile ( file ) : DICTIONARY_BUCKET_URL = get_configuration ( ) . get ( 'VERSIONS' , 'versionsurl' ) url = urllib . parse . urljoin ( DICTIONARY_BUCKET_URL , file_name ) logger . log ( logging . INFO , "Downloading dictionary %s at %s" % ( file_name , url ) ) urlretrieve ( url , file ) with open ( file , 'r' ) as fp : self . __setstate__ ( json . load ( fp ) )
Download the dictionary version and cache the retrieved file.
        :return: None
Download the dictionary version and cache the retrieved file . : return : None