Ignore:
Timestamp:
Mar 18, 2009, 2:59:21 PM (16 years ago)
Author:
gah
Message:

preliminary HQ output from molvisviewer; unexpand tabs; all jpeg generation at 100%

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/bugreport.tcl

    r1274 r1342  
    5252
    5353    if {"@SHOWDETAILS" == $err} {
    54         pack forget .bugreport.xmit
    55         pack forget .bugreport.ok
    56         pack .bugreport.details -after .bugreport.banner \
    57             -expand yes -fill both -padx 8 -pady 8
    58         focus .bugreport.details.cntls.ok
    59         return
     54        pack forget .bugreport.xmit
     55        pack forget .bugreport.ok
     56        pack .bugreport.details -after .bugreport.banner \
     57            -expand yes -fill both -padx 8 -pady 8
     58        focus .bugreport.details.cntls.ok
     59        return
    6060    }
    6161
     
    6767
    6868    if {[shouldReport for oops]} {
    69         pack forget .bugreport.details
    70         pack forget .bugreport.expl
    71         pack .bugreport.ok -side bottom -after .bugreport.banner -pady {0 8}
    72         pack .bugreport.xmit -after .bugreport.ok -padx 8 -pady 8
    73         focus .bugreport.ok
    74         set dosubmit 1
     69        pack forget .bugreport.details
     70        pack forget .bugreport.expl
     71        pack .bugreport.ok -side bottom -after .bugreport.banner -pady {0 8}
     72        pack .bugreport.xmit -after .bugreport.ok -padx 8 -pady 8
     73        focus .bugreport.ok
     74        set dosubmit 1
    7575    } else {
    76         pack forget .bugreport.expl
    77         pack forget .bugreport.xmit
    78         pack forget .bugreport.ok
    79         pack .bugreport.details -after .bugreport.banner \
    80             -expand yes -fill both -padx 8 -pady 8
    81         focus .bugreport.details.cntls.ok
    82         set dosubmit 0
     76        pack forget .bugreport.expl
     77        pack forget .bugreport.xmit
     78        pack forget .bugreport.ok
     79        pack .bugreport.details -after .bugreport.banner \
     80            -expand yes -fill both -padx 8 -pady 8
     81        focus .bugreport.details.cntls.ok
     82        set dosubmit 0
    8383    }
    8484
     
    9696
    9797    if {$dosubmit} {
    98         submit
     98        submit
    9999    }
    100100}
     
    141141    # handle the result
    142142    if {$status != 0} {
    143         # add error to the details field, so we can see it with magic clicks
    144         .bugreport.details.info.text configure -state normal
    145         .bugreport.details.info.text insert 1.0 "Ticket submission failed:\n$result\n-----\n"
    146         .bugreport.details.info.text configure -state disabled
    147 
    148         .bugreport.expl insert end "This tool encountered an unexpected error.  We tried to submit a trouble report automatically, but that failed.  If you want to report this incident, you can file your own trouble report.  Look for the \"Help\" or \"Support\" links on the main navigation bar of the web site.\n\nIf you continue having trouble with this tool, please close it and launch another session."
     143        # add error to the details field, so we can see it with magic clicks
     144        .bugreport.details.info.text configure -state normal
     145        .bugreport.details.info.text insert 1.0 "Ticket submission failed:\n$result\n-----\n"
     146        .bugreport.details.info.text configure -state disabled
     147
     148        .bugreport.expl insert end "This tool encountered an unexpected error.  We tried to submit a trouble report automatically, but that failed.  If you want to report this incident, you can file your own trouble report.  Look for the \"Help\" or \"Support\" links on the main navigation bar of the web site.\n\nIf you continue having trouble with this tool, please close it and launch another session."
    149149    } elseif {[regexp {Ticket #([0-9]*) +\((.*?)\) +([0-9]+) +times} $result match ticket extra times]} {
    150         .bugreport.expl insert end "This tool encountered an unexpected error.  The problem has been reported as " "" "Ticket #$ticket" bold " in our system." ""
    151         if {[string is integer $times] && $times > 1} {
    152             .bugreport.expl insert end "  This particular problem has been reported $times times."
    153         }
    154         .bugreport.expl insert end "\n\nIf you continue having trouble with this tool, please close it and launch another session."
     150        .bugreport.expl insert end "This tool encountered an unexpected error.  The problem has been reported as " "" "Ticket #$ticket" bold " in our system." ""
     151        if {[string is integer $times] && $times > 1} {
     152            .bugreport.expl insert end "  This particular problem has been reported $times times."
     153        }
     154        .bugreport.expl insert end "\n\nIf you continue having trouble with this tool, please close it and launch another session."
    155155    } else {
    156         .bugreport.expl insert end "This tool encountered an unexpected error, and the problem was reported.  Here is the response from the hub, which may contain information about your ticket:\n" "" $result bold "\n\nIf you continue having trouble with this tool, please close it and launch another session." ""
     156        .bugreport.expl insert end "This tool encountered an unexpected error, and the problem was reported.  Here is the response from the hub, which may contain information about your ticket:\n" "" $result bold "\n\nIf you continue having trouble with this tool, please close it and launch another session." ""
    157157    }
    158158    for {set h 1} {$h < 50} {incr h} {
    159         .bugreport.expl configure -height $h
    160         .bugreport.expl see 1.0
    161         update idletasks
    162         if {"" != [.bugreport.expl bbox end-1char]} {
    163             break
    164         }
     159        .bugreport.expl configure -height $h
     160        .bugreport.expl see 1.0
     161        update idletasks
     162        if {"" != [.bugreport.expl bbox end-1char]} {
     163            break
     164        }
    165165    }
    166166    .bugreport.expl configure -state disabled
     
    195195
    196196    if {![regexp {^([^\n]+)\n} $stackTrace match summary]} {
    197         if {[string length $stackTrace] == 0} {
    198             set summary "Unexpected error from Rappture"
    199         } else {
    200             set summary $stackTrace
    201         }
     197        if {[string length $stackTrace] == 0} {
     198            set summary "Unexpected error from Rappture"
     199        } else {
     200            set summary $stackTrace
     201        }
    202202    }
    203203    if {[string length $summary] > 200} {
    204         set summary "[string range $summary 0 200]..."
     204        set summary "[string range $summary 0 200]..."
    205205    }
    206206    if {[string match {Problem launching job*} $summary]} {
    207         append summary " (in tool \"[Rappture::Tool::resources -appname]\")"
    208         set category "Tools"
     207        append summary " (in tool \"[Rappture::Tool::resources -appname]\")"
     208        set category "Tools"
    209209    } else {
    210         set category "Rappture"
     210        set category "Rappture"
    211211    }
    212212
     
    214214    set toolong 20000
    215215    if {[string length $stackTrace] > $toolong} {
    216         #
    217         # If this came from "Problem launching job", then it will have
    218         # a "== RAPPTURE INPUT ==" part somewhere in the middle.  Try
    219         # to show the first part, this middle part, and the very last
    220         # part, cutting out whatever we have to in the middle.
    221         #
    222         if {[regexp -indices {\n== RAPPTURE INPUT ==\n} $stackTrace match]} {
    223             foreach {smid0 smid1} $match break
    224             set quarter [expr {$toolong/4}]
    225             set s0 $quarter
    226             set smid0 [expr {$smid0-$quarter}]
    227             set smid1 [expr {$smid1+$quarter}]
    228             set s1 [expr {[string length $stackTrace]-$quarter}]
    229 
    230             if {$smid0 < $s0} {
    231                 # first part is short -- truncate last part
    232                 set stackTrace "[string range $stackTrace 0 $smid1]\n...\n[string range $stackTrace [expr {[string length $stackTrace]-($toolong-$smid1)}] end]"
    233             } elseif {$smid1 > $s1} {
    234                 # last part is short -- truncate first part
    235                 set tailsize [expr {[string length $stackTrace]-$smid0}]
    236                 set stackTrace "[string range $stackTrace 0 [expr {$toolong-$tailsize}]]\n...\n[string range $stackTrace $smid0 end]"
    237             } else {
    238                 # rappture input line is right about in the middle
    239                 set stackTrace "[string range $stackTrace 0 $s0]\n...\n[string range $stackTrace $smid0 $smid1]\n...\n[string range $stackTrace $s1 end]"
    240             }
    241         } else {
    242             # no Rappture input -- just show first part and last part
    243             set half [expr {$toolong/2}]
    244             set stackTrace "[string range $stackTrace 0 $half]\n...\n[string range $stackTrace [expr {[string length $stackTrace]-$half}] end]"
    245         }
     216        #
     217        # If this came from "Problem launching job", then it will have
     218        # a "== RAPPTURE INPUT ==" part somewhere in the middle.  Try
     219        # to show the first part, this middle part, and the very last
     220        # part, cutting out whatever we have to in the middle.
     221        #
     222        if {[regexp -indices {\n== RAPPTURE INPUT ==\n} $stackTrace match]} {
     223            foreach {smid0 smid1} $match break
     224            set quarter [expr {$toolong/4}]
     225            set s0 $quarter
     226            set smid0 [expr {$smid0-$quarter}]
     227            set smid1 [expr {$smid1+$quarter}]
     228            set s1 [expr {[string length $stackTrace]-$quarter}]
     229
     230            if {$smid0 < $s0} {
     231                # first part is short -- truncate last part
     232                set stackTrace "[string range $stackTrace 0 $smid1]\n...\n[string range $stackTrace [expr {[string length $stackTrace]-($toolong-$smid1)}] end]"
     233            } elseif {$smid1 > $s1} {
     234                # last part is short -- truncate first part
     235                set tailsize [expr {[string length $stackTrace]-$smid0}]
     236                set stackTrace "[string range $stackTrace 0 [expr {$toolong-$tailsize}]]\n...\n[string range $stackTrace $smid0 end]"
     237            } else {
     238                # rappture input line is right about in the middle
     239                set stackTrace "[string range $stackTrace 0 $s0]\n...\n[string range $stackTrace $smid0 $smid1]\n...\n[string range $stackTrace $s1 end]"
     240            }
     241        } else {
     242            # no Rappture input -- just show first part and last part
     243            set half [expr {$toolong/2}]
     244            set stackTrace "[string range $stackTrace 0 $half]\n...\n[string range $stackTrace [expr {[string length $stackTrace]-$half}] end]"
     245        }
    246246    }
    247247
    248248    set query [http::formatQuery \
    249         option com_support \
    250         task create \
    251         no_html 1 \
    252         report $stackTrace \
    253         login $tcl_platform(user) \
    254         sesstoken [Rappture::Tool::resources -session] \
    255         hostname [info hostname] \
    256         category $category \
    257         summary $summary \
    258         referrer "tool \"[Rappture::Tool::resources -appname]\"" \
     249        option com_support \
     250        task create \
     251        no_html 1 \
     252        report $stackTrace \
     253        login $tcl_platform(user) \
     254        sesstoken [Rappture::Tool::resources -session] \
     255        hostname [info hostname] \
     256        category $category \
     257        summary $summary \
     258        referrer "tool \"[Rappture::Tool::resources -appname]\"" \
    259259    ]
    260260   
    261261    set url [Rappture::Tool::resources -huburl]
    262262    if {[string index $url end] == "/"} {
    263         append url "index.php"
     263        append url "index.php"
    264264    } else {
    265         append url "/index.php"
     265        append url "/index.php"
    266266    }
    267267
     
    269269
    270270    if {[http::ncode $token] != 200} {
    271         error [http::code $token]
     271        error [http::code $token]
    272272    }
    273273    upvar #0 $token rval
     
    276276
    277277    if {[regexp {Ticket #[0-9]* +\(.*?\) +[0-9]+ +times} $info match]} {
    278         return $match
     278        return $match
    279279    }
    280280    error "Report received, but ticket may not have been filed.  Here's the result...\n$info"
     
    296296
    297297    switch -- $option {
    298         jobfailures {
    299             variable reportJobFailures
    300             if {![string is boolean $value]} {
    301                 error "bad value \"$value\": should be boolean"
    302             }
    303             set reportJobFailures $value
    304         }
    305         for {
    306             # is this a tool in production?
    307             if {![info exists env(RAPPTURE_VERSION)]
    308                   || $env(RAPPTURE_VERSION) != "current"} {
    309                 return 0
    310             }
    311 
    312             # is it being run within a workspace?
    313             set appname [Rappture::Tool::resources -appname]
    314             if {[string match {[Ww]orkspace*} $appname]} {
    315                 return 0
    316             }
    317 
    318             # if this is a problem launching a job and the tool
    319             # expects this, then don't bother with automatic reports.
    320             variable reportJobFailures
    321             if {"jobs" == $value && !$reportJobFailures} {
    322                 return 0
    323             }
    324 
    325             # this is a real problem -- report it!
    326             return 1
    327         }
    328         default {
    329             error "bad option \"$option\": should be jobfailures or for"
    330         }
     298        jobfailures {
     299            variable reportJobFailures
     300            if {![string is boolean $value]} {
     301                error "bad value \"$value\": should be boolean"
     302            }
     303            set reportJobFailures $value
     304        }
     305        for {
     306            # is this a tool in production?
     307            if {![info exists env(RAPPTURE_VERSION)]
     308                  || $env(RAPPTURE_VERSION) != "current"} {
     309                return 0
     310            }
     311
     312            # is it being run within a workspace?
     313            set appname [Rappture::Tool::resources -appname]
     314            if {[string match {[Ww]orkspace*} $appname]} {
     315                return 0
     316            }
     317
     318            # if this is a problem launching a job and the tool
     319            # expects this, then don't bother with automatic reports.
     320            variable reportJobFailures
     321            if {"jobs" == $value && !$reportJobFailures} {
     322                return 0
     323            }
     324
     325            # this is a real problem -- report it!
     326            return 1
     327        }
     328        default {
     329            error "bad option \"$option\": should be jobfailures or for"
     330        }
    331331    }
    332332}
Note: See TracChangeset for help on using the changeset viewer.