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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 1 06:35:02 EDT 2011


Author: martinl
Date: 2011-07-01 03:35:02 -0700 (Fri, 01 Jul 2011)
New Revision: 46914

Modified:
   grass/trunk/lib/init/grass.py
Log:
grass.py: don't delete gislock on concurrent usage


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2011-07-01 10:22:00 UTC (rev 46913)
+++ grass/trunk/lib/init/grass.py	2011-07-01 10:35:02 UTC (rev 46914)
@@ -52,6 +52,7 @@
 
 tmpdir = None
 lockfile = None
+remove_lockfile = True
 location = None
 create_new = None
 grass_gui = None
@@ -82,10 +83,10 @@
             try_rmdir(os.path.join(root, name))
     
 def cleanup():
-    tmpdir, lockfile
+    tmpdir, lockfile, remove_lockfile
     # all exits after setting up $tmpdir should also tidy it up
     cleanup_dir(tmpdir)
-    if lockfile:
+    if lockfile and remove_lockfile:
 	try_remove(lockfile)
 
 def fatal(msg):
@@ -584,12 +585,15 @@
                 "Concurrent use not allowed." % \
                     { 'user' : user, 'file' : lockfile })
     else:
-	msg = _("Unable to properly access \"%s\"\nPlease notify system personel.") % lockfile
+	msg = _("Unable to properly access '%s'.\n"
+                "Please notify system personel.") % lockfile
     
     if msg:
         if grass_gui == "wxpython":
             thetest = call([os.getenv('GRASS_PYTHON'), os.path.join(wxpython_base, "gis_set_error.py"), msg])
         else:
+            global remove_lockfile
+            remove_lockfile = False
             fatal(msg)
     
 def make_fontcap():



More information about the grass-commit mailing list