util/registry.tcl
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 getpackage pregistry registry/registry.tcl
00008
00009 namespace ::sak::registry {}
00010
00011 ret ::sak::registry::local (type args) {
00012 return [uplevel 1 [linsert $args 0 [Setup]]]
00013 # return <$_local {expand}$args>
00014 }
00015
00016 ret ::sak::registry::Setup () {
00017 variable _local
00018 variable state
00019 variable statedir
00020
00021 if {![file exists $statedir]} {
00022 file mkdir $statedir
00023 }
00024
00025 if {$_local == {}} {
00026 set _local [pregistry %AUTO% \
00027 -tie [list file $state]]
00028 }
00029
00030 return $_local
00031 }
00032
00033 ret ::sak::registry::Refresh () {
00034 variable _local
00035 $_local destroy
00036 set _local {}
00037 Setup
00038 return
00039 }
00040
00041 namespace ::sak::registry {
00042 variable _here [file dirname [info script]]
00043
00044 variable statedir [file join ~ .Tcllib]
00045 variable state [file join $statedir Registry]
00046 variable _local {}
00047 }
00048
00049
00050
00051
00052
00053 package provide sak::registry 1.0
00054
00055
00056
00057
00058
00059
00060
00061
00062