diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-05-12 21:30:49 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-05-12 21:30:49 -0400 |
commit | 05a446d694ad2b49829a1a0dc1ec37337a92a724 (patch) | |
tree | 2fea9afe62b3c05f32d84cceae7a25deffb00528 /blackboard2gradebook.tcl | |
parent | b2ebfdd3bc2a2fc7fead33017ce1a320c6000f40 (diff) | |
download | GradeBook-05a446d694ad2b49829a1a0dc1ec37337a92a724.tar.gz GradeBook-05a446d694ad2b49829a1a0dc1ec37337a92a724.zip |
nice treatment of DRYRUN
Diffstat (limited to 'blackboard2gradebook.tcl')
-rwxr-xr-x | blackboard2gradebook.tcl | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/blackboard2gradebook.tcl b/blackboard2gradebook.tcl index 5bce8e2..909c8dd 100755 --- a/blackboard2gradebook.tcl +++ b/blackboard2gradebook.tcl @@ -42,11 +42,6 @@ try { exit 1 } -# if DRYRUN is true the database will not be modified -set DRYRUN true -set DRYRUN [expr {!$params(w)}] - - ################# Config ############################################ #set categories2export [list FinalExam HomeWork LabReport] set categories2export [list FinalExam] @@ -57,6 +52,13 @@ set infoColumsMarkers {{ - Lateness \(H:M:S\)} { - Max Points} { - Submission Ti set skipCreationCol [concat $commonInfoCol $infoColumsMarkers] ###################################################################### +# if DRYRUN is true the database will not be modified +set DRYRUN true +set DRYRUN [expr {!$params(w)}] +if { $DRYRUN} { + puts "DRYRUN: DB will not be modified" +} + set classDB [lindex $argv 0] set blackboardDB [lindex $argv 1] @@ -150,7 +152,6 @@ proc trimColName { col } { return [list $shortCol $category $maxScore $type] } -set wasDRYRUNAnounced false proc dbRequest {script} { # verbose evaluation of dbRequest with dry run capability global DRYRUN @@ -160,11 +161,7 @@ proc dbRequest {script} { if {$line eq ""} {continue} append cmd $line\n if { [info complete $cmd] } { - if { [info exists DRYRUN] && $DRYRUN} { - if { ! $wasDRYRUNAnounced } { - set wasDRYRUNAnounced true - puts "DRYRUN: DB will not be modified" - } + if { ![info exists DRYRUN] || $DRYRUN} { #puts -nonewline "DRYRUN: $cmd" } else { puts -nonewline "Executing: $cmd" |