From 3da564c7ab5eca5aa25ecd2cf367ae140aea324f Mon Sep 17 00:00:00 2001 From: Julien Veyssier <eneiluj@posteo.net> Date: Wed, 22 Apr 2020 02:58:35 +0200 Subject: [PATCH] fix step1 tqdm import (only if executed) Signed-off-by: Julien Veyssier <eneiluj@posteo.net> --- modules/hrudelin_1_init.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/hrudelin_1_init.py b/modules/hrudelin_1_init.py index 20762d8..804dff1 100755 --- a/modules/hrudelin_1_init.py +++ b/modules/hrudelin_1_init.py @@ -45,16 +45,6 @@ except Exception as e: print('or if you don\'t have superuser access:\n') print('%spip3 install dbf%s\n' % (COLOR_GREEN, COLOR_RESET)) -try: - from tqdm import tqdm -except Exception as e: - print('!!! %s tqdm python3 module not found !!%s\n' % (COLOR_RED, COLOR_RESET)) - print('On Debian/Ubuntu/Linux Mint you can install it with:\n') - print('%ssudo apt install python3-tqdm%s\n' % (COLOR_GREEN, COLOR_RESET)) - print('or if you don\'t have superuser access:\n') - print('%spip3 install tqdm%s\n' % (COLOR_GREEN, COLOR_RESET)) - sys.exit(1) - MY_ABS_PATH=os.path.abspath(__file__) MY_DIR=os.path.dirname(MY_ABS_PATH) DATA_PATH=os.path.join(MY_DIR, '..', 'data') @@ -349,6 +339,16 @@ if __name__ == '__main__': from progressColors import * from parallel import buildGrassEnv from ogr2ogr import main as ogr2ogrMain + try: + from tqdm import tqdm + except Exception as e: + print('!!! %s tqdm python3 module not found !!%s\n' % (COLOR_RED, COLOR_RESET)) + print('On Debian/Ubuntu/Linux Mint you can install it with:\n') + print('%ssudo apt install python3-tqdm%s\n' % (COLOR_GREEN, COLOR_RESET)) + print('or if you don\'t have superuser access:\n') + print('%spip3 install tqdm%s\n' % (COLOR_GREEN, COLOR_RESET)) + sys.exit(1) + parms_file = 'hrudelin_config.cfg' if len(sys.argv) > 1: parms_file = sys.argv[1] -- GitLab