xo::api proc script_name (public)
xo::api script_name [ -obj obj ] scope
Defined in packages/xotcl-core/tcl/01-debug-procs.tcl
Determine name of the current "script" as displayed by "Defined in" in the API browser. Define different sources available in different situatons.
- Switches:
- -obj (optional)
- class name for identifying the source filename
- Parameters:
- scope (required)
- either empty or thread name
- Returns:
- path starting with the "packages" directory
- Testcases:
- No testcase defined.
Source code: # # Determine name of the current "script" as displayed by "Defined # in" in the API browser. Define different sources available in # different situatons. # # @param obj class name for identifying the source filename # @param scope either empty or thread name # @return path starting with the "packages" directory # set script [info script] if {$script eq "" || [file tail $script] eq "procdoc-init.tcl"} { set script "" if {$script eq "" && [info exists obj] && [nsv_get proc_source_file " Class $obj" script]} { #ns_log notice "INIT script_name of $obj from proc_source_file => <$script>" } if {$script eq "" && [info exists obj]} { set class [::nsf::directdispatch $obj ::nsf::methods::object::info::class] if {[nsv_get proc_source_file " Class $class" script]} { #ns_log notice "INIT script_name of $obj via $class from proc_source_file => <$script>" } } if {$script eq "" && [info exists ::xotcl::currentScript]} { set script $::xotcl::currentScript } set root_dir $::acs::rootdir set root_length [string length $root_dir] if { $root_dir eq [string range $script 0 $root_length-1]} { set script [string range $script $root_length+1 end] } } return $scriptXQL Not present: Generic, PostgreSQL, Oracle