Forráskód Böngészése

Made shell scripts more generic

Mark Mine 22 éve
szülő
commit
e2557e2204

+ 2 - 2
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

+ 5 - 3
direct/src/leveleditor/copyfiles

@@ -3,15 +3,17 @@
 if [ "$1" = "-d" ]
 if [ "$1" = "-d" ]
 then
 then
     destdir=$2
     destdir=$2
+    printfilesCmd=$3
     debug_state="-d"
     debug_state="-d"
 else
 else
     destdir=$1
     destdir=$1
+    printfilesCmd=$2
     debug_state=""
     debug_state=""
 fi
 fi
 
 
-if [ "${destdir}" = "" ]
+if [ "${destdir}" = "" -o "${printfilesCmd}" = "" ]
 then
 then
-	echo "Usage: copyfiles [-d] destdir"
+	echo "Usage: copyfiles [-d] destdir printfilesCmd"
 	exit 1
 	exit 1
 fi
 fi
 
 
@@ -21,7 +23,7 @@ then
 	exit 1
 	exit 1
 fi
 fi
 
 
-for file in `printfiles $debug_state`
+for file in `$printfilesCmd $debug_state`
 do
 do
 	if cp -R ${file} ${destdir}
 	if cp -R ${file} ${destdir}
 	then
 	then

+ 1 - 1
direct/src/leveleditor/zipfiles

@@ -27,7 +27,7 @@ fi
 
 
 if mkdir ${destdir}
 if mkdir ${destdir}
 then
 then
-    if copyfiles ${debug_state} ${destdir}
+    if copyfiles ${debug_state} ${destdir} printfiles
     then
     then
 	if [ -f ${zipfile} ]
 	if [ -f ${zipfile} ]
 	then
 	then

+ 6 - 3
direct/src/showbase/ShowBase.py

@@ -204,11 +204,12 @@ class ShowBase(DirectObject.DirectObject):
         self.transitions = Transitions.Transitions(self.loader)
         self.transitions = Transitions.Transitions(self.loader)
 
 
         # Start Tk and DIRECT if specified by Configrc
         # 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
         # Start DIRECT if specified in Configrc or in cluster mode
         fDirect = (self.config.GetBool('want-directtools', 0) or
         fDirect = (self.config.GetBool('want-directtools', 0) or
                    (base.config.GetString("cluster-mode", '') != ''))
                    (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
         # Start IGLOOP
         self.restart()
         self.restart()
 
 
@@ -1198,9 +1199,11 @@ class ShowBase(DirectObject.DirectObject):
         self.wantTk = fWantTk
         self.wantTk = fWantTk
         if self.wantTk:
         if self.wantTk:
             import TkGlobal
             import TkGlobal
+            taskMgr.remove('tkloop')
             TkGlobal.spawnTkLoop()
             TkGlobal.spawnTkLoop()
 
 
-    def startDirect(self, fWantDirect = 1):
+    def startDirect(self, fWantDirect = 1, fWantTk = 1):
+        self.startTk(fWantTk)
         self.wantDirect = fWantDirect
         self.wantDirect = fWantDirect
         if self.wantDirect:
         if self.wantDirect:
             import DirectSession
             import DirectSession