[GRASS-SVN] r66613 - grass/branches/releasebranch_7_0/scripts/db.in.ogr
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 27 04:47:04 PDT 2015
Author: martinl
Date: 2015-10-27 04:47:04 -0700 (Tue, 27 Oct 2015)
New Revision: 66613
Modified:
grass/branches/releasebranch_7_0/scripts/db.in.ogr/db.in.ogr.py
Log:
db.in.ogr: fix when DB connection is not defined
(merge r66612 from trunk)
Modified: grass/branches/releasebranch_7_0/scripts/db.in.ogr/db.in.ogr.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/db.in.ogr/db.in.ogr.py 2015-10-27 11:44:34 UTC (rev 66612)
+++ grass/branches/releasebranch_7_0/scripts/db.in.ogr/db.in.ogr.py 2015-10-27 11:47:04 UTC (rev 66613)
@@ -71,7 +71,13 @@
output = grass.basename(tmpname)
# check if table exists
- s = grass.read_command('db.tables', flags = 'p', quiet=True)
+ try:
+ s = grass.read_command('db.tables', flags = 'p', quiet=True)
+ except CalledModuleError:
+ # check connection parameters, set if uninitialized
+ grass.read_command('db.connect', flags='c')
+ s = grass.read_command('db.tables', flags = 'p', quiet=True)
+
for l in s.splitlines():
if l == output:
if grass.overwrite():
More information about the grass-commit
mailing list