From 2869597fffdb85f1c02ecec502bcd1f489919348 Mon Sep 17 00:00:00 2001
From: Ansgar Philippsen <ansgar.philippsen@gmail.com>
Date: Thu, 16 Jun 2011 16:12:07 -0400
Subject: [PATCH] fixed broken implementation to distinguish between batch mode
 (ost) and gui mode (gosty); now available as ost.gui_mode flag

---
 modules/gui/src/gosty.cc | 1 +
 scripts/init_cl.py       | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/gui/src/gosty.cc b/modules/gui/src/gosty.cc
index 19b91bcbe..cb1ed7384 100644
--- a/modules/gui/src/gosty.cc
+++ b/modules/gui/src/gosty.cc
@@ -167,6 +167,7 @@ int init_python_interpreter()
   }  
   setup_python_search_path(root, py);
   py.RunCommand("from ost import *");
+  py.RunCommand("gui_mode=True");
   return 0;
 }
 
diff --git a/scripts/init_cl.py b/scripts/init_cl.py
index 5c080e95d..09b38ed97 100644
--- a/scripts/init_cl.py
+++ b/scripts/init_cl.py
@@ -1,8 +1,6 @@
 import sys, os, platform
 import optparse
 
-interactive=False
-
 def show_help(option, opt, value, parser):
   parser.print_help()
   sys.exit(-1)
@@ -49,7 +47,11 @@ def _InitRuleBasedBuilder():
 _InitRuleBasedBuilder()
 import os.path
 HistoryFile=os.path.expanduser('~/.ost_history')
+
+# this is a silly name...
 InGUIMode=False
+# ... lets be more pythonic
+gui_mode=False
 
 sys.ps1='ost> '
 sys.ps2='..... '
-- 
GitLab