########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Friday 13 April 2007 13:49:59 
#    
#       The Scripps Research Institute (TSRI)
#       Molecular Graphics Lab
#       La Jolla, CA 92037, USA
#
# Copyright: Daniel Stoffler, Michel Sanner and TSRI
#   
# revision: Guillaume Vareille
#  
#########################################################################
#
# $Header: /opt/cvs/python/packages/share1.5/Vision/doc/Examples/matplotlib/Spy2_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#
# $Id: Spy2_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#

from traceback import print_exc
## loading libraries ##
from Vision.matplotlibNodes import matplotliblib
masterNet.getEditor().addLibraryInstance(matplotliblib,"Vision.matplotlibNodes", "matplotliblib")

from Vision.StandardNodes import stdlib
masterNet.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")

try:
    ## saving node Spy2 ##
    from Vision.matplotlibNodes import Spy2NE
    Spy2_144 = Spy2NE(constrkw = {}, name='Spy2', library=matplotliblib)
    masterNet.addNode(Spy2_144,110,290)
except:
    print "WARNING: failed to restore Spy2NE named Spy2 in network masterNet"
    print_exc()
    Spy2_144=None

try:
    ## saving node ReadTable ##
    from Vision.StandardNodes import ReadTable
    ReadTable_145 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_145,69,33)
    ReadTable_145.inputPortByName['filename'].widget.set("Data/spy_data.dat", run=False)
    ReadTable_145.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_145.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_145.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_145=None

try:
    ## saving node As Type ##
    from Vision.StandardNodes import AsType
    As_Type_146 = AsType(constrkw = {}, name='As Type', library=stdlib)
    masterNet.addNode(As_Type_146,83,198)
    apply(As_Type_146.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore AsType named As Type in network masterNet"
    print_exc()
    As_Type_146=None

masterNet.freeze()

## saving connections for network Spy2 ##
if ReadTable_145 is not None and As_Type_146 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_145, As_Type_146, "data", "inArrayList", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_145 and As_Type_146 in network masterNet"
if As_Type_146 is not None and Spy2_144 is not None:
    try:
        masterNet.connectNodes(
            As_Type_146, Spy2_144, "outArray", "Z", blocking=True)
    except:
        print "WARNING: failed to restore connection between As_Type_146 and Spy2_144 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

