Posted to tcl by patthoyts at Fri Aug 15 10:26:58 GMT 2008view raw

  1. # For development, it is very convenient to be able to drop the extra
  2. # packages into the CVS tree. Make sure we have the real location of
  3. # the script and not a link.
  4. set script [file normalize [info script]]
  5. while {[file type $script] eq "link"} {
  6. set script [file join [file dirname $script] [file readlink $script]]
  7. }
  8. set tkchat_dir [file dirname [file normalize $script]]
  9.  
  10.  
  11. # -------------------------------------------------------------------------
  12. # Load in plugins from our directory and ~/.tkchat_plugins or from
  13. # anything in env(TKCHAT_PLUGINS) which may be a tcl list of directories.
  14.  
  15. set dirs [list $tkchat_dir [file normalize ~/.tkchat_plugins]]
  16. if {[info exists env(TKCHAT_PLUGINS)]} {
  17. set dirs [linsert $env(TKCHAT_PLUGINS) 0 $tkchat_dir]
  18. }
  19. foreach dir $dirs {
  20. foreach file [glob -nocomplain -directory $dir \
  21. tkchat_*.tcl mousewheel.tcl] {
  22. if {[file exists $file] && [file readable $file]} {
  23. if {[catch {source $file} err]} {
  24. ::bgerror $err
  25. }
  26. }
  27. }
  28. }