diff -Nru biomaj3-daemon-3.0.19/biomaj_daemon/daemon/biomaj_daemon_web.py biomaj3-daemon-3.0.20/biomaj_daemon/daemon/biomaj_daemon_web.py --- biomaj3-daemon-3.0.19/biomaj_daemon/daemon/biomaj_daemon_web.py 2019-03-01 07:57:54.000000000 +0000 +++ biomaj3-daemon-3.0.20/biomaj_daemon/daemon/biomaj_daemon_web.py 2019-03-19 13:59:03.000000000 +0000 @@ -154,7 +154,9 @@ 'proxy': None, 'schedule': False, 'history': False, - 'historyLimit': 20 + 'historyLimit': 20, + 'datalist': False, + 'dataimport': False } diff -Nru biomaj3-daemon-3.0.19/biomaj_daemon/daemon/utils.py biomaj3-daemon-3.0.20/biomaj_daemon/daemon/utils.py --- biomaj3-daemon-3.0.19/biomaj_daemon/daemon/utils.py 2019-03-01 07:57:54.000000000 +0000 +++ biomaj3-daemon-3.0.20/biomaj_daemon/daemon/utils.py 2019-03-19 13:59:03.000000000 +0000 @@ -712,6 +712,8 @@ ''' get the status of a bank during an update cycle ''' + if not options.bank: + return (False, 'bank option is missing') if not options.proxy: return (False, 'option not allowed without --proxy option') redis_client = redis.StrictRedis( @@ -827,6 +829,27 @@ return (True, msg) +def biomaj_data_list(options, config): + try: + from biomaj_data.utils import list as blist + return (True, 'Bank templates: ' + str(blist())) + except Exception: + return (False, 'biomaj-data package not installed') + + +def biomaj_data_import(options, config): + if not options.bank: + return (False, 'option bank is missing') + try: + from biomaj_data.utils import importTo + (err, file_path) = importTo(options.bank, BiomajConfig.global_config.get('GENERAL', 'conf.dir')) + if err: + return (False, file_path) + return (True, 'Bank imported: ' + str(file_path)) + except Exception: + return (False, 'biomaj-data package not installed') + + def biomaj_history(options, config): history = Bank.get_history(options.historyLimit) results = [] @@ -925,5 +948,9 @@ if options.aboutme: return biomaj_user_info(options, config) + if options.datalist: + return biomaj_data_list(options, config) + if options.dataimport: + return biomaj_data_import(options, config) return (False, "no option match") diff -Nru biomaj3-daemon-3.0.19/CHANGES.txt biomaj3-daemon-3.0.20/CHANGES.txt --- biomaj3-daemon-3.0.19/CHANGES.txt 2019-03-01 07:57:54.000000000 +0000 +++ biomaj3-daemon-3.0.20/CHANGES.txt 2019-03-19 13:59:03.000000000 +0000 @@ -1,3 +1,6 @@ +3.0.20: + Add some checks on options + Add data-list and data-import options 3.0.19: Fix traefix prefix 3.0.18: diff -Nru biomaj3-daemon-3.0.19/debian/changelog biomaj3-daemon-3.0.20/debian/changelog --- biomaj3-daemon-3.0.19/debian/changelog 2019-03-09 10:23:28.000000000 +0000 +++ biomaj3-daemon-3.0.20/debian/changelog 2019-11-12 10:34:19.000000000 +0000 @@ -1,3 +1,9 @@ +biomaj3-daemon (3.0.20-1) unstable; urgency=medium + + * New upstream release + + -- Olivier Sallou Tue, 12 Nov 2019 10:34:19 +0000 + biomaj3-daemon (3.0.19-1) unstable; urgency=medium * New upstream release diff -Nru biomaj3-daemon-3.0.19/setup.py biomaj3-daemon-3.0.20/setup.py --- biomaj3-daemon-3.0.19/setup.py 2019-03-01 07:57:54.000000000 +0000 +++ biomaj3-daemon-3.0.20/setup.py 2019-03-19 13:59:03.000000000 +0000 @@ -21,7 +21,7 @@ 'url': 'http://biomaj.genouest.org', 'download_url': 'http://biomaj.genouest.org', 'author_email': 'olivier.sallou@irisa.fr', - 'version': '3.0.19', + 'version': '3.0.20', 'classifiers': [ # How mature is this project? Common values are # 3 - Alpha