Fossil SCM

Semantics of the progress display extended to allow an empty maximum to signal use of an infinite (open-ended) display.

aku 2007-09-17 01:41 trunk
Commit ebb94f75cb229fddf31e3eb8d81b9cf056593b2e
1 file changed +7 -1
--- tools/lib/log.tcl
+++ tools/lib/log.tcl
@@ -12,10 +12,12 @@
1212
1313
# Feedback generation.
1414
#
1515
# vc::tools::log::write verbosity system text - Write message to the log.
1616
# vc::tools::log::progress verbosity system n max - Drive a progress display.
17
+#
18
+# Note: max empty => infinite progress display, otherwise a finite display.
1719
1820
# Administrative operations.
1921
#
2022
# vc::tools::log::verbosity level - Set the verbosity level of the application.
2123
# vc::tools::log::verbosity? - Query the verbosity level of the application.
@@ -122,11 +124,15 @@
122124
123125
# Progress handler. Uses \r to return to the beginning of the current
124126
# line without advancing.
125127
126128
proc ::vc::tools::log::OUT/progress {system n max} {
127
- puts -nonewline "$system [format %[string length $max]s $n]/$max\r"
129
+ if {$max eq {}} {
130
+ puts -nonewline "$system $n\r"
131
+ } else {
132
+ puts -nonewline "$system [format %[string length $max]s $n]/$max\r"
133
+ }
128134
flush stdout
129135
return
130136
}
131137
132138
# -----------------------------------------------------------------------------
133139
--- tools/lib/log.tcl
+++ tools/lib/log.tcl
@@ -12,10 +12,12 @@
12
13 # Feedback generation.
14 #
15 # vc::tools::log::write verbosity system text - Write message to the log.
16 # vc::tools::log::progress verbosity system n max - Drive a progress display.
 
 
17
18 # Administrative operations.
19 #
20 # vc::tools::log::verbosity level - Set the verbosity level of the application.
21 # vc::tools::log::verbosity? - Query the verbosity level of the application.
@@ -122,11 +124,15 @@
122
123 # Progress handler. Uses \r to return to the beginning of the current
124 # line without advancing.
125
126 proc ::vc::tools::log::OUT/progress {system n max} {
127 puts -nonewline "$system [format %[string length $max]s $n]/$max\r"
 
 
 
 
128 flush stdout
129 return
130 }
131
132 # -----------------------------------------------------------------------------
133
--- tools/lib/log.tcl
+++ tools/lib/log.tcl
@@ -12,10 +12,12 @@
12
13 # Feedback generation.
14 #
15 # vc::tools::log::write verbosity system text - Write message to the log.
16 # vc::tools::log::progress verbosity system n max - Drive a progress display.
17 #
18 # Note: max empty => infinite progress display, otherwise a finite display.
19
20 # Administrative operations.
21 #
22 # vc::tools::log::verbosity level - Set the verbosity level of the application.
23 # vc::tools::log::verbosity? - Query the verbosity level of the application.
@@ -122,11 +124,15 @@
124
125 # Progress handler. Uses \r to return to the beginning of the current
126 # line without advancing.
127
128 proc ::vc::tools::log::OUT/progress {system n max} {
129 if {$max eq {}} {
130 puts -nonewline "$system $n\r"
131 } else {
132 puts -nonewline "$system [format %[string length $max]s $n]/$max\r"
133 }
134 flush stdout
135 return
136 }
137
138 # -----------------------------------------------------------------------------
139

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button