Changeset 925 for trunk


Ignore:
Timestamp:
Mar 6, 2008 2:23:54 PM (16 years ago)
Author:
gah
Message:

Fix: changed _CheckServerList to proc from method

File:
1 edited

Legend:

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

    r924 r925  
    3939    }
    4040    # Used internally only.
    41     private method _CheckNameList {namelist}
    4241    private method _Shuffle { hostlist }
    4342    private method _ReceiveHelper {}
     
    4544    private method _SendHelper {}
    4645
    47     protected method SendEcho {channel {data ""}}
    48     protected method ReceiveEcho {channel {data ""}}
     46    protected method SendEcho { channel {data ""} }
     47    protected method ReceiveEcho { channel {data ""} }
    4948    protected method Connect { hostlist }
    5049    protected method Disconnect {}
     
    5352    protected method ReceiveBytes { nbytes }
    5453    protected method Flush {}
    55     protected method Color2RGB {color}
    56     protected method Euler2XYZ {theta phi psi}
    57 
    58     public proc SetPymolServerList {namelist} {
    59         _CheckNameList $namelist
    60         set _servers(pymol) $namelist
    61     }
    62     public proc SetNanovisServerList {namelist} {
    63         _CheckNameList $namelist
    64         set _servers(nanovis) $namelist
    65     }
    66     public proc SetServerList {tag namelist} {
     54    protected method Color2RGB { color }
     55    protected method Euler2XYZ { theta phi psi }
     56
     57    private proc _CheckNameList { namelist }  {
     58        set pattern {^[a-zA-Z0-9\.]+:[0-9]+(,[a-zA-Z0-9\.]+:[0-9]+)*$}
     59        if { ![regexp $pattern $namelist match] } {
     60            error "bad visualization server address \"$namelist\": should be host:port,host:port,..."
     61        }
     62    }
     63    public proc GetServerList { tag } {
     64        return $_servers($tag)
     65    }
     66    public proc SetServerList { tag namelist } {
    6767        _CheckNameList $namelist
    6868        set _servers($tag) $namelist
    6969    }
    70     public proc GetServerList { tag } {
    71         return $_servers($tag)
     70    public proc SetPymolServerList { namelist } {
     71        SetServerList "pymol" $namelist
     72    }
     73    public proc SetNanovisServerList { namelist } {
     74        SetServerList "nanovis" $namelist
    7275    }
    7376}
     
    154157    }
    155158    return $random_hosts
    156 }
    157 
    158 #
    159 # _CheckNameList --
    160 #
    161 #    Used within the class to check if provide list of hostname:port are
    162 #    correct.  Return an error if the list is invalid.
    163 #
    164 itcl::body Rappture::VisViewer::_CheckNameList { namelist } {
    165     set pattern {^[a-zA-Z0-9\.]+:[0-9]+(,[a-zA-Z0-9\.]+:[0-9]+)*$}
    166     if { ![regexp $pattern $namelist match] } {
    167         error "bad visualization server address \"$namelist\": should be host:port,host:port,..."
    168     }
    169159}
    170160
Note: See TracChangeset for help on using the changeset viewer.