Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hru-delin-dev
hru-delin
Commits
0367d00f
Unverified
Commit
0367d00f
authored
May 27, 2020
by
Julien Veyssier
Browse files
fix some imports
Signed-off-by:
Julien Veyssier
<
eneiluj@posteo.net
>
parent
9bdf117b
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/circleKill.py
View file @
0367d00f
...
...
@@ -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
'
)
...
...
modules/hrudelin_1_init.py
View file @
0367d00f
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment