Posted to tcl by Siqsuruq at Thu Dec 22 22:06:27 GMT 2022view raw

  1. :public method load_dz_procs {args} {
  2. set folders [glob -nocomplain -directory [file join ${:path} [: get_global mod_dir]] *]
  3. foreach f $folders {
  4. set module_namepace [file tail $f]
  5. set files [glob -nocomplain -directory $f *.tcl]
  6. foreach file $files {
  7. if {[regexp {Class.tcl} $file] == 1} {
  8. source $file
  9. } else {
  10. # It will give error that $file not found
  11. namespace eval $module_namepace { source $file }
  12. }
  13. }
  14. }
  15. }