Ignore:
Timestamp:
Apr 26, 2006, 6:42:46 PM (18 years ago)
Author:
mmc
Message:
  • Added <description> capability to output objects, including axes.
  • Fixed the ResultSet? so that it is more compact and supports the simulation number as a parameter. This is useful when there are datasets with wildly varying parameters.
File:
1 edited

Legend:

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

    r213 r413  
    2727namespace eval Rappture::filexfer {
    2828    variable enabled 0                 ;# set to 1 when this is running
    29     variable port 9001                 ;# start server on this port
     29    variable port 0                    ;# start server on this port
    3030    variable cookie ""                 ;# magic cookie for applet auth
    3131    variable restrictClientAddress ""  ;# allow clients only from this addr
     
    7575    }
    7676
    77     #
    78     # Set up a safe interpreter for loading filexfer options...
    79     #
    80     variable optionParser [interp create -safe]
    81     foreach cmd [$optionParser eval {info commands}] {
    82         $optionParser hide $cmd
    83     }
    84     # this lets us ignore unrecognized commands in the file:
    85     $optionParser invokehidden proc unknown {args} {}
    86 
    87     $optionParser alias filexfer_port Rappture::filexfer::option_port
    88     $optionParser alias filexfer_cookie Rappture::filexfer::option_cookie
    89     $optionParser alias filexfer_sitelogo Rappture::filexfer::option_sitelogo
    90     $optionParser alias filexfer_stylesheet Rappture::filexfer::option_stylesheet
     77}
     78
     79# must use this name -- plugs into Rappture::resources::load
     80proc filexfer_init_resources {} {
     81    Rappture::resources::register \
     82        filexfer_port Rappture::filexfer::option_port \
     83        filexfer_cookie Rappture::filexfer::option_cookie \
     84        filexfer_sitelogo Rappture::filexfer::option_sitelogo \
     85        filexfer_stylesheet Rappture::filexfer::option_stylesheet
    9186}
    9287
     
    9994# ----------------------------------------------------------------------
    10095proc Rappture::filexfer::init {} {
    101     global env
    102     variable optionParser
    10396    variable enabled
    10497    variable port
     
    109102
    110103    #
    111     # Look for a $SESSION variable and a file called
    112     # ~/data/sessions/$SESSION/resources.  If found, then
    113     # load the settings from that file and start a server
    114     # for filexfer.
    115     #
    116     if {[info exists env(SESSION)]} {
    117         set file ~/data/sessions/$env(SESSION)/resources
    118         if {![file exists $file]} {
    119             return 0
    120         }
    121         if {[catch {
    122             set fid [open $file r]
    123             set info [read $fid]
    124             close $fid
    125             $optionParser eval $info
    126         } result]} {
    127             after 1 [list tk_messageBox -title Error -icon error -message "Error in resources file:\n$reslt"]
    128             return 0
    129         }
    130 
     104    # The port setting should have been set properly in the
     105    # "resources" file loaded at the beginning of the app.
     106    # If it wasn't, then don't do any filexfer.
     107    #
     108    if {$port > 0} {
    131109        #
    132110        # If the prescribed port is busy, then exit with a special
Note: See TracChangeset for help on using the changeset viewer.