@@ -0,0 +1,1266 @@
+import os%0Aimport sys%0Aimport glob%0Aimport shutil%0Aimport logging%0Afrom .ontology import BioOntology, CACHE_DIR%0A%0Alogger = logging.getLogger('indra.ontology.bio')%0A%0Aif __name__ == '__main__':%0A    import ipdb; ipdb.set_trace()%0A    if len(sys.argv) %3C 2:%0A        logger.info('Operation missing. Supported operations: '%0A                    'build, clean, clean-old, clean-all.')%0A        sys.exit(1)%0A    operation = sys.argv%5B1%5D%0A    if operation == 'build':%0A        BioOntology().initialize()%0A    elif operation.startswith('clean'):%0A        parent_dir = os.path.normpath(os.path.join(CACHE_DIR, os.pardir))%0A        version_paths = glob.glob(os.path.join(parent_dir, '*', ''))%0A        if operation == 'clean-all':%0A            to_remove = %5Bparent_dir%5D%0A        else:%0A            to_remove = %5B%5D%0A            for version_path in version_paths:%0A                version = os.path.basename(os.path.normpath(version_path))%0A                if operation == 'clean-old' and version != BioOntology.version:%0A                    to_remove.append(version_path)%0A                elif operation == 'clean' and version == BioOntology.version:%0A                    to_remove.append(version_path)%0A        for rem in to_remove:%0A            logger.info('Removing %25s' %25 rem)%0A            shutil.rmtree(rem)%0A

Add CLI to regenerate ontology