Changeset 0df7881 for fedd


Ignore:
Timestamp:
Jun 15, 2011 6:20:27 PM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, info-ops, master
Children:
c410811a
Parents:
37ecf7e
Message:

Properly place LANs on multi-grouped diagrams

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_image.py

    r37ecf7e r0df7881  
    7171            add_to_map(sg, e.get_attribute(attr) or 'default', e)
    7272        elif isinstance(e, topdl.Substrate):
    73             # A little hairy.  Make a set of the values of the given attribute
     73            # A little hairy.  If the substrate itself has the attribute, use
     74            # that.  Otherwise, make a set of the values of the given attribute
    7475            # for all the elements in the substrate's interfaces.  If that set
    7576            # has one element, put the substrate in that subgraph.  Otherwise
    7677            # put it in default.
    77             atts = set([i.element.get_attribute(attr) or 'default' \
    78                     for i in e.interfaces])
    79 
    80             if len(atts) == 1: add_to_map(sg, atts.pop(), e)
    81             else: add_to_map(sg, 'default', e)
     78
     79            sa = e.get_attribute(attr)
     80            if sa is not None:
     81                add_to_map(sg, sa, e)
     82            else:
     83                atts = set([i.element.get_attribute(attr) or 'default' \
     84                        for i in e.interfaces])
     85
     86                if len(atts) == 1: add_to_map(sg, atts.pop(), e)
     87                else: add_to_map(sg, 'default', e)
    8288
    8389    if rest:
Note: See TracChangeset for help on using the changeset viewer.