From e2557e22047a2664989cb8175e57e3787d053bc6 Mon Sep 17 00:00:00 2001 From: Mark Mine Date: Wed, 1 Oct 2003 20:35:12 +0000 Subject: [PATCH] Made shell scripts more generic --- direct/src/leveleditor/Sources.pp | 4 ++-- direct/src/leveleditor/copyfiles | 8 +++++--- direct/src/leveleditor/zipfiles | 2 +- direct/src/showbase/ShowBase.py | 9 ++++++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/direct/src/leveleditor/Sources.pp b/direct/src/leveleditor/Sources.pp index a03ea8c336..eaefc6c7d9 100644 --- a/direct/src/leveleditor/Sources.pp +++ b/direct/src/leveleditor/Sources.pp @@ -1,3 +1,3 @@ -// For now, since we are not installing Python files, this file can -// remain empty. +// Install scripts for building zipfiles (leveleditor and RobotToonManager) +#define INSTALL_SCRIPTS printdir printlib copyfiles diff --git a/direct/src/leveleditor/copyfiles b/direct/src/leveleditor/copyfiles index bc3c577d80..63fc67d21c 100755 --- a/direct/src/leveleditor/copyfiles +++ b/direct/src/leveleditor/copyfiles @@ -3,15 +3,17 @@ if [ "$1" = "-d" ] then destdir=$2 + printfilesCmd=$3 debug_state="-d" else destdir=$1 + printfilesCmd=$2 debug_state="" fi -if [ "${destdir}" = "" ] +if [ "${destdir}" = "" -o "${printfilesCmd}" = "" ] then - echo "Usage: copyfiles [-d] destdir" + echo "Usage: copyfiles [-d] destdir printfilesCmd" exit 1 fi @@ -21,7 +23,7 @@ then exit 1 fi -for file in `printfiles $debug_state` +for file in `$printfilesCmd $debug_state` do if cp -R ${file} ${destdir} then diff --git a/direct/src/leveleditor/zipfiles b/direct/src/leveleditor/zipfiles index 8342edbb97..a90c6b0986 100755 --- a/direct/src/leveleditor/zipfiles +++ b/direct/src/leveleditor/zipfiles @@ -27,7 +27,7 @@ fi if mkdir ${destdir} then - if copyfiles ${debug_state} ${destdir} + if copyfiles ${debug_state} ${destdir} printfiles then if [ -f ${zipfile} ] then diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index e5c7e54012..7bc62ddf59 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -204,11 +204,12 @@ class ShowBase(DirectObject.DirectObject): self.transitions = Transitions.Transitions(self.loader) # Start Tk and DIRECT if specified by Configrc - self.startTk(self.config.GetBool('want-tk', 0)) + fTk = self.config.GetBool('want-tk', 0) # Start DIRECT if specified in Configrc or in cluster mode fDirect = (self.config.GetBool('want-directtools', 0) or (base.config.GetString("cluster-mode", '') != '')) - self.startDirect(fDirect) + # Set fWantTk to 0 to avoid starting Tk with this call + self.startDirect(fWantDirect = fDirect, fWantTk = fTk) # Start IGLOOP self.restart() @@ -1198,9 +1199,11 @@ class ShowBase(DirectObject.DirectObject): self.wantTk = fWantTk if self.wantTk: import TkGlobal + taskMgr.remove('tkloop') TkGlobal.spawnTkLoop() - def startDirect(self, fWantDirect = 1): + def startDirect(self, fWantDirect = 1, fWantTk = 1): + self.startTk(fWantTk) self.wantDirect = fWantDirect if self.wantDirect: import DirectSession