En raison du déménagement des baies serveurs, les services gitlab.irstea.fr et mattermost.irstea.fr seront interrompus le samedi 2 octobre 2021 au matin. Ils devraient revenir à la normale dans la journée.

Unverified Commit 0367d00f authored by Julien Veyssier's avatar Julien Veyssier
Browse files

fix some imports


Signed-off-by: default avatarJulien Veyssier <eneiluj@posteo.net>
parent 9bdf117b
......@@ -6,7 +6,7 @@ try:
DBF=True
except Exception as e:
DBF=False
print('!!! Warning, dbf python3 module not found, no dbf file will be generated')
print('!!! Warning, dbf python3 module not found, no topology dbf file will be generated')
print('Install dbf module with: sudo apt install python3-dbf')
print('or if you don\'t have superuser access: pip3 install dbf\n')
......
......@@ -26,26 +26,6 @@ except Exception as e:
#import grass.script as grass
from grass.script.utils import decode, encode
try:
from osgeo import gdal
from osgeo import ogr
except Exception as e:
print('!!! %spython3-gdal was not found on your system, did you install it?%s' % (COLOR_RED, COLOR_RESET))
print('On Debian/Ubuntu/Linux Mint you can install it with:\n')
print('%ssudo apt install python3-gdal%s\n' % (COLOR_GREEN, COLOR_RESET))
print('or if you don\'t have superuser access:\n')
print('%spip3 install GDAL%s\n' % (COLOR_GREEN, COLOR_RESET))
sys.exit(1)
try:
import dbf
except Exception as e:
print('!!! %sdbf python3 module was not found on your system, no .dbf file will be generated.%s' % (COLOR_YELLOW, COLOR_RESET))
print('On Debian/Ubuntu/Linux Mint you can install it with:\n')
print('%ssudo apt install python3-dbf%s\n' % (COLOR_GREEN, COLOR_RESET))
print('or if you don\'t have superuser access:\n')
print('%spip3 install dbf%s\n' % (COLOR_GREEN, COLOR_RESET))
MY_ABS_PATH=os.path.abspath(__file__)
MY_DIR=os.path.dirname(MY_ABS_PATH)
DATA_PATH=os.path.join(MY_DIR, '..', 'data')
......@@ -337,6 +317,25 @@ def main(parms_file):
if __name__ == '__main__':
from progressColors import *
try:
from osgeo import gdal
from osgeo import ogr
except Exception as e:
print('!!! %spython3-gdal was not found on your system, did you install it?%s' % (COLOR_RED, COLOR_RESET))
print('On Debian/Ubuntu/Linux Mint you can install it with:\n')
print('%ssudo apt install python3-gdal%s\n' % (COLOR_GREEN, COLOR_RESET))
print('or if you don\'t have superuser access:\n')
print('%spip3 install GDAL%s\n' % (COLOR_GREEN, COLOR_RESET))
sys.exit(1)
try:
import dbf
except Exception as e:
print('!!! %sdbf python3 module was not found on your system, no topology .dbf file will be generated.%s' % (COLOR_YELLOW, COLOR_RESET))
print('On Debian/Ubuntu/Linux Mint you can install it with:\n')
print('%ssudo apt install python3-dbf%s\n' % (COLOR_GREEN, COLOR_RESET))
print('or if you don\'t have superuser access:\n')
print('%spip3 install dbf%s\n' % (COLOR_GREEN, COLOR_RESET))
from grassUtils import buildGrassEnv, grass_run_command, grass_parse_command, grass_feed_command
from ogr2ogr import main as ogr2ogrMain
try:
......@@ -361,5 +360,24 @@ if __name__ == '__main__':
pass
else:
from .progressColors import *
try:
from osgeo import gdal
from osgeo import ogr
except Exception as e:
print('!!! python3-gdal was not found on your system, did you install it?')
print('On Debian/Ubuntu/Linux Mint you can install it with:\n')
print('sudo apt install python3-gdal\n')
print('or if you don\'t have superuser access:\n')
print('pip3 install GDAL\n')
sys.exit(1)
try:
import dbf
except Exception as e:
print('!!! dbf python3 module was not found on your system, no topology .dbf file will be generated.')
print('On Debian/Ubuntu/Linux Mint you can install it with:\n')
print('sudo apt install python3-dbf\n')
print('or if you don\'t have superuser access:\n')
print('pip3 install dbf\n')
from .grassUtils import buildGrassEnv, grass_run_command, grass_parse_command, grass_feed_command
from .ogr2ogr import main as ogr2ogrMain
\ No newline at end of file
from .ogr2ogr import main as ogr2ogrMain
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment