Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5586 for data/media/tcl


Ignore:
Timestamp:
Jul 26, 2009, 1:04:34 AM (15 years ago)
Author:
landauf
Message:

fixed a problem with orxonox' wrapper of the unknown proc
added some path utilities: [pwd], [psd] and [pld] for working, start and library directory respectively ($pwd, $psd and $pld are the corresponding variables)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • data/media/tcl/init.tcl

    r5585 r5586  
    9393
    9494set filepath [info script]
    95 set ::orxonox::mediapath [string range $filepath 0 [string last "/" $filepath]]
     95#set ::orxonox::mediapath [string range $filepath 0 [string last "/" $filepath]]
     96set ::orxonox::mediapath [file dirname $filepath]
    9697if {[lsearch $auto_path $::orxonox::mediapath] == -1} {
    9798    lappend auto_path $::orxonox::mediapath
    9899}
    99100unset filepath
     101
     102
     103# save the start directory and the library directory
     104
     105proc psd {} "return [pwd]"
     106proc pld {} "return $::orxonox::mediapath"
     107
     108set pwd [pwd]
     109set psd [psd]
     110set pld [pld]
     111
     112
     113# modify cd to automatically set $pwd
     114
     115if {[llength [info command ::tcl::cd]] == 0} {
     116    rename cd ::tcl::cd
     117}
     118proc cd {{path "~"}} {
     119    global pwd
     120    ::tcl::cd $path
     121    set pwd [pwd]
     122}
    100123
    101124
     
    187210            global ::orxonox::errormessage_unknown ::orxonox::errormessage_unknown_length
    188211
    189 tcl::puts "unknown: $args"
    190             set errorcode [catch {::tcl::unknown $args} result options]
     212            set cmd [concat ::tcl::unknown $args]
     213            set errorcode [catch {eval $cmd} result options]
    191214            set resultlist [split $result]
    192215            set success 1
    193 tcl::puts "errorcode: $errorcode resultlist: $resultlist"
     216
    194217            if {$errorcode && [llength $resultlist] >= $::orxonox::errormessage_unknown_length} {
    195218                for {set i 0} {$i < $::orxonox::errormessage_unknown_length} {incr i} {
     
    199222                    }
    200223                }
     224            } else {
     225                set success 0
    201226            }
    202 tcl::puts "success: $success"
     227
    203228            if {!$success} {
    204229                return -code $errorcode -options $options $result
Note: See TracChangeset for help on using the changeset viewer.