godot/dot_data_parser.py
def _proc_edge_stmt(self, toks):
        """ Returns a tuple of the form (ADD_EDGE, src, dest, options).
        """
        opts = toks[3]
        dummy_edge = Edge("dummy1", "dummy2")
        # Coerce attribute types.
        for key, value in opts.iteritems():
            trait = dummy_edge.trait(key)
            if trait is not None:
                # FIXME: Implement Graphviz spline types.
                if trait.is_trait_type( List ):
                    p = [] # List of float doublets.
                    for t in value.split( " " ):
                        l = t.split( "," )
                        if len(l) == 3: # pos="e,39,61 39,97 39,89 39,80 39,71"
                            l.pop(0)
                        f = [ float(a) for a in l ]
                        p.append( tuple(f) )
                    opts[key] = p

                elif trait.is_trait_type( Float ):
                    opts[key] = float( value )

                elif trait.is_trait_type( Tuple ):
                    opts[key] = tuple( [float(c) for c in value.split(",")] )

        return super(GodotDataParser, self)._proc_edge_stmt(toks)
def _proc_edge_stmt(self, toks):
        """ Returns a tuple of the form (ADD_EDGE, src, dest, options).
        """
        opts = toks[3]
        dummy_edge = Edge("dummy1", "dummy2")
        # Coerce attribute types.
        for key, value in opts.iteritems():
            trait = dummy_edge.trait(key)
            if trait is not None:
                # FIXME: Implement Graphviz spline types.
                if trait.is_trait_type( List ):
                    p = [] # List of float doublets.
                    for t in value.split( " " ):
                        l = t.split( "," )
                        if len(l) == 3: # pos="e,39,61 39,97 39,89 39,80 39,71"
                            l.pop(0)
                        f = [ float(a) for a in l ]
                        p.append( tuple(f) )
                    opts[key] = p

                elif trait.is_trait_type( Float ):
                    opts[key] = float( value )

                elif trait.is_trait_type( Tuple ):
                    opts[key] = tuple( [float(c) for c in value.split(",")] )

        return super(GodotDataParser, self)._proc_edge_stmt(toks)
def _proc_edge_stmt ( self , toks ) : opts = toks [ 3 ] dummy_edge = Edge ( "dummy1" , "dummy2" ) # Coerce attribute types. for key , value in opts . iteritems ( ) : trait = dummy_edge . trait ( key ) if trait is not None : # FIXME: Implement Graphviz spline types. if trait . is_trait_type ( List ) : p = [ ] # List of float doublets. for t in value . split ( " " ) : l = t . split ( "," ) if len ( l ) == 3 : # pos="e,39,61 39,97 39,89 39,80 39,71" l . pop ( 0 ) f = [ float ( a ) for a in l ] p . append ( tuple ( f ) ) opts [ key ] = p elif trait . is_trait_type ( Float ) : opts [ key ] = float ( value ) elif trait . is_trait_type ( Tuple ) : opts [ key ] = tuple ( [ float ( c ) for c in value . split ( "," ) ] ) return super ( GodotDataParser , self ) . _proc_edge_stmt ( toks )
Returns a tuple of the form (ADD_EDGE, src, dest, options).
Returns a tuple of the form ( ADD_EDGE src dest options ) .