[Orxonox-commit 846] r2213 - media/tcl

landauf at orxonox.net landauf at orxonox.net
Tue Jul 28 16:53:49 CEST 2009


Author: landauf
Date: 2009-07-28 16:53:48 +0200 (Tue, 28 Jul 2009)
New Revision: 2213

Modified:
   media/tcl/init.tcl
   media/tcl/remote.tcl
Log:
changes in init.tcl:
 - check if tcl was properly initialized
 - bugfix in puts
 - added backwards compatibility in unknown

Modified: media/tcl/init.tcl
===================================================================
--- media/tcl/init.tcl	2009-07-27 20:35:37 UTC (rev 2212)
+++ media/tcl/init.tcl	2009-07-28 14:53:48 UTC (rev 2213)
@@ -1,3 +1,7 @@
+# Check if Tcl was properly initialized
+info library
+
+# Create orxonox namespace
 namespace eval orxonox {}
 
 # query --
@@ -162,7 +166,7 @@
     if {$channel == "stdout" || $channel == "stderr"} {
         execute puts $newline $s
     } else {
-        ::tcl::puts $args
+        eval [concat ::tcl::puts $args]
     }
 }
 
@@ -179,9 +183,9 @@
 
     # get the returned errormessage if an undefined_proc command is called
     if {[llength [info commands ::tcl::unknown]] == 0} {
-        set errorcode [catch {unknown undefined_proc} result options]
+        set errorcode [catch {unknown undefined_proc} result]
     } else {
-        set errorcode [catch {::tcl::unknown undefined_proc} result options]
+        set errorcode [catch {::tcl::unknown undefined_proc} result]
     }
 
     if {$errorcode} {
@@ -210,7 +214,11 @@
             global ::orxonox::errormessage_unknown ::orxonox::errormessage_unknown_length
 
             set cmd [concat ::tcl::unknown $args]
-            set errorcode [catch {eval $cmd} result options]
+            if {[info tclversion] < 8.5} {
+                set errorcode [catch {eval $cmd} result]
+            } else {
+                set errorcode [catch {eval $cmd} result options]
+            }
             set resultlist [split $result]
             set success 1
 
@@ -226,7 +234,11 @@
             }
 
             if {!$success} {
-                return -code $errorcode -options $options $result
+                if {[info tclversion] < 8.5} {
+                    return -code $errorcode $result
+                } else {
+                    return -code $errorcode -options $options $result
+                }
             } else {
                 return [query $args]
             }
@@ -239,7 +251,6 @@
 
     unset errorcode
     unset result
-    unset options
 
     # if the "undefined_proc" command was renamed previously, undo this
     if {$undefined_was_defined} {

Modified: media/tcl/remote.tcl
===================================================================
--- media/tcl/remote.tcl	2009-07-27 20:35:37 UTC (rev 2212)
+++ media/tcl/remote.tcl	2009-07-28 14:53:48 UTC (rev 2213)
@@ -1,2 +1,2 @@
 set telnetserverthreadid [TclThreadManager create]
-TclThreadManager execute $telnetserverthreadid source telnet_server.tcl
+TclThreadManager execute $telnetserverthreadid source $pld/telnet_server.tcl




More information about the Orxonox-commit mailing list