TeaKpot.tk

This is an early attempt to wrap a GUI around teacup, an interface to ActiveState's teapot technology.

The following code isn't very pretty. Some of the problems include:

  • the teacup invocations on my machine are quite slow
  • the data is displayed as csv records, in very small windows
  • Ideally, the first entry in ::newer and ::uninstalled would be extracted and turned into column headings
  • Another nice touch might be a title line (not a part of the listbox) that listed the number of entries to install
  • Also, a button for "install all newer items" "all uninstalled items" and "everything outstanding" would be a nice shortcut
#! tclsh8.5

package require Tk
package require csv

set ::newer [list]
set ::uninstalled [list]

proc install {args} {
 set cmdlist [::csv::split $args]
 set cmd "teacup install --force --with-recommends -v [lindex $cmdlist 1] -exact [lindex $cmdlist 2] -is [lindex $cmdlist 0]"
 
 puts "$cmd"
 puts [exec {*}$cmd]
}

proc newer {} { 
    set ::newer [exec teacup list --as csv --only newer]

    pack [scrolledlistbox .slbNewer $::newer install] -fill both -expand 1
    return
}

proc uninstalled {} { 
    set ::uninstalled [exec teacup list --as csv --only uninstalled]
    pack [scrolledlistbox .slbUninstalled $::uninstalled install] -fill both -expand 1
    return
}

# This next file is from https://wiki.tcl-lang.org/15614
source scrolledlistbox.tcl


newer
uninstalled