[GRASS-SVN] r73704 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 24 02:52:25 PST 2018


Author: mmetz
Date: 2018-11-24 02:52:25 -0800 (Sat, 24 Nov 2018)
New Revision: 73704

Modified:
   grass/trunk/lib/init/grass.py
Log:
libinit: use clean_default_db() from script.setup

Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2018-11-24 10:51:08 UTC (rev 73703)
+++ grass/trunk/lib/init/grass.py	2018-11-24 10:52:25 UTC (rev 73704)
@@ -2228,22 +2228,10 @@
 
         # close GUI if running
         close_gui()
-        # clean the sqlite db
-        from grass.script import db as gdb
-        from grass.script import core as gcore
-        conn = gdb.db_connection()
-        if conn and conn['driver'] == 'sqlite':
-	    # check if db exists
-	    gisenv = gcore.gisenv()
-	    database = conn['database']
-	    database = database.replace('$GISDBASE', gisenv['GISDBASE'])
-	    database = database.replace('$LOCATION_NAME', gisenv['LOCATION_NAME'])
-	    database = database.replace('$MAPSET', gisenv['MAPSET'])
-	    if os.path.exists(database):
-		message(_("Cleaning up sqlite database ..."))
-		gcore.start_command('db.execute', sql = 'VACUUM')
 
         # here we are at the end of grass session
+	from grass.script import setup as gsetup
+	gsetup.clean_default_db()
         clear_screen()
         # save 'last used' GISRC after removing variables which shouldn't
         # be saved, e.g. d.mon related



More information about the grass-commit mailing list