class DBUpdater: def __init__(self, db_name, protocol="http", source=""): self.db_name= db_name fantom_tmp_path= os.path.join(fantom_tmp_dir, '%s.txt' % db_name) urls= all_db_urls[db_name] self.download_manager= DownloadManager(db_name, download_dir, protocol, urls) self.parser = Parser(db_name, fantom_tmp_path, self.download_manager, source) self.updater= BioDBUpdater(db_name, sql_db_path, fantom_tmp_path ) def run(self): print "Downloading the database..." self.download_manager.download() print "Parsing files..." self.parser.parse() print "Updating sqlite database..." self.updater.store_database() def stats(self): self.n_ids="" self.n_levels=""
def __init__(self, db_name, protocol="http", source=""): self.db_name= db_name fantom_tmp_path= os.path.join(fantom_tmp_dir, '%s.txt' % db_name) urls= all_db_urls[db_name] self.download_manager= DownloadManager(db_name, download_dir, protocol, urls) self.parser = Parser(db_name, fantom_tmp_path, self.download_manager, source) self.updater= BioDBUpdater(db_name, sql_db_path, fantom_tmp_path )