texlive[45095] Master/texmf-dist/scripts/tlshell/tlshell.tcl:

commits+siepo at tug.org commits+siepo at tug.org
Tue Aug 22 22:24:30 CEST 2017


Revision: 45095
          http://tug.org/svn/texlive?view=revision&revision=45095
Author:   siepo
Date:     2017-08-22 22:24:29 +0200 (Tue, 22 Aug 2017)
Log Message:
-----------
Optional debug notebook tab; cosmetic changes

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl

Modified: trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl
===================================================================
--- trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl	2017-08-22 14:36:53 UTC (rev 45094)
+++ trunk/Master/texmf-dist/scripts/tlshell/tlshell.tcl	2017-08-22 20:24:29 UTC (rev 45095)
@@ -1,10 +1,6 @@
 #!/usr/bin/env wish
 package require Tk
 
-# This version:
-# - example of doing something with selected database item
-# - restart self
-
 # searchpath:
 # windows: most scripts run via [w]runscript, which adjusts the searchpath
 # for the current process.
@@ -27,9 +23,6 @@
 set out_log {}
 
 # dicts of package dicts
-if 0 {
-  set pkgs {}
-}
 set pkgs_local {}
 set pkgs_remote {}
 set pkgs pkgs_local
@@ -41,6 +34,8 @@
 proc do_debug {s} {
   if {$::ddebug} {
     puts stderr $s
+    .dbg.tx configure -state normal
+    .dbg.tx insert end "$s\n"
   }
 }
 
@@ -77,7 +72,6 @@
   do_debug "read_err"
   set len 0
   while 1 {
-    do_debug "read_err: one iteration"
     set len [chan gets $::err l]
     if {$len >= 0} {
       lappend ::err_log $l
@@ -100,7 +94,7 @@
     catch {chan close $::tlshl}
     err_exit
   } elseif {$len >= 0} {
-    do_debug "read: $l"
+    # do_debug "read: $l"
     if {[string first $::prmpt $l] == 0} {
       # prompt line: done with command
       read_err
@@ -202,8 +196,6 @@
 proc log_widget_cb {mode {l ""}} {
   if {$mode eq "line"} {
     .log.tx configure -state normal
-    do_debug "to log widget:"
-    do_debug $l
     .log.tx insert end "$l\n"
   } elseif {$mode eq "init"} {
     .log.tx configure -state normal
@@ -390,8 +382,8 @@
     .pkglist heading $col -text $nm -anchor w
   }
   .pkglist column name -width [expr $cw * 25]
-  .pkglist column localrev -width [expr $cw * 10]
-  .pkglist column remoterev -width [expr $cw * 10]
+  .pkglist column localrev -width [expr $cw * 12]
+  .pkglist column remoterev -width [expr $cw * 12]
   .pkglist column shortdesc -width [expr $cw * 50]
 
   ttk::scrollbar .pkhsb -orient horizontal -command {.pkglist xview}
@@ -423,9 +415,25 @@
       -expand 1 -fill both
   .err.tx yview moveto 1
 
+  if $::ddebug {
+    frame .dbg
+    pack [ttk::scrollbar .dbg.scroll -command ".dbg.tx yview"] \
+        -side right -fill y
+    pack [text .dbg.tx -height 10 -bd 2 -relief groove -wrap word \
+        -yscrollcommand ".dbg.scroll set"] \
+        -expand 1 -fill both
+    .dbg.tx yview moveto 1
+  }
+
   ttk::notebook .logs
   .logs add .log -text "Output"
   .logs add .err -text "Errors"
+  if $::ddebug {
+    .logs add .dbg -text "Debug"
+  }
+  if $::ddebug {
+    raise .dbg .logs
+  }
   raise .err .logs
   raise .log .logs
   pack .logs -side top -fill x -expand 1 -padx 3 -pady 6



More information about the tex-live-commits mailing list