Mercurial > dive4elements > river
comparison flys-backend/contrib/shpimporter/shpimporter.py @ 4989:f4d61ac84b76 dami
If we bother to check if the file is readable we might also
bother to check if it's a file at all.
Thanks to teichmann for noticing
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 14 Feb 2013 10:54:02 +0100 |
parents | b5ac7588cf4d |
children | d19c07c10986 |
comparison
equal
deleted
inserted
replaced
4978:b5ac7588cf4d | 4989:f4d61ac84b76 |
---|---|
229 DEBUG("%i x geometry type %s" % (types[key], key)) | 229 DEBUG("%i x geometry type %s" % (types[key], key)) |
230 | 230 |
231 if not config.skip_dgm: | 231 if not config.skip_dgm: |
232 dgmfilename = os.path.join( | 232 dgmfilename = os.path.join( |
233 config.directory, "..", "DGMs.csv") | 233 config.directory, "..", "DGMs.csv") |
234 if not os.access(dgmfilename, os.R_OK): | 234 if not os.access(dgmfilename, os.R_OK) or not \ |
235 os.path.isfile(dgmfilename): | |
235 INFO("Could not find or access DGM file: %s \n" | 236 INFO("Could not find or access DGM file: %s \n" |
236 "Skipping DGM import." % dgmfilename) | 237 "Skipping DGM import." % dgmfilename) |
237 else: | 238 else: |
238 INFO("Inserting DGM meta information in 'dem' table.") | 239 INFO("Inserting DGM meta information in 'dem' table.") |
239 insertRiverDgm(dbconn_raw, dgmfilename, river_name, config.dry_run) | 240 insertRiverDgm(dbconn_raw, dgmfilename, river_name, config.dry_run) |