Last active
November 10, 2020 09:48
-
-
Save micabe/f5b630e3583133342bbabfa0b848e3c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import brainvisa.axon.processes | |
brainvisa.axon.processes.initializeProcesses() | |
context = brainvisa.processes.defaultContext() | |
def get_databases(): | |
"""Get the list of Brainvisa databases.""" | |
from brainvisa.processes import neuroConfig | |
return [dbs.directory for dbs in neuroConfig.dataPath if not dbs.builtin] | |
def update(dbPath): | |
"""Update the database.""" | |
print('Updating %s database.' % (dbPath)) | |
try: | |
db = databases.database(dbPath) | |
db.clear(context=context) | |
db.update(context=context) | |
except: | |
return | |
def update_databases(): | |
"""Update the databases.""" | |
for database in get_databases(): | |
update(database) | |
from brainvisa.data import neuroHierarchy | |
from brainvisa.data.neuroHierarchy import * | |
if __name__ == '__main__': | |
descriptionMsg = \ | |
'''Update BrainVisa databases.''' | |
update_databases() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment