Kaynağa Gözat

alf: wait for the batch job to be finished; don't open GUI in batch mode

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42536 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 15 yıl önce
ebeveyn
işleme
f905bfba9a
1 değiştirilmiş dosya ile 13 ekleme ve 4 silme
  1. 13 4
      lib/init/grass.py

+ 13 - 4
lib/init/grass.py

@@ -613,10 +613,13 @@ def check_batch_job():
 	    # right file, but ...
 	    fatal(_("Change file permission to 'executable' for '%s'") % batch_job)
 	else:
-	    message(_("Executing '%s'...") % batch_job)
+	    message(_("Executing '%s' ...") % batch_job)
 	    grass_gui = "text"
-	    Popen(batch_job, shell = True)
-    
+	    shell = batch_job
+	    bj = Popen(shell,shell=True)
+	    bj.wait()
+	    message(_("Execution of '%s' finished.") % batch_job)
+
 def start_gui():
     # Start the chosen GUI but ignore text
     if grass_debug:
@@ -968,13 +971,19 @@ check_shell()
 
 check_batch_job()
 
-start_gui()
+if not batch_job:	
+    start_gui()
 
 clear_screen()
 
 # Display the version and license info
 if batch_job:
     say_hello()
+    grass_gui = 'text'
+    clear_screen()
+    clean_temp()
+    try_remove(lockfile)
+    sys.exit(0)
 else:
     show_banner()
     say_hello()