Ejemplo n.º 1
0
def color_interface_line(interface_id):
    catalog = Catalog()
    interface = catalog.interface(interface_id)
    hierarchy = [
        cl.__name__ for cl in reversed(inspect.getmro(interface))
        if cl in catalog._interfaces.values()
    ]
    hierarchy = ' > '.join(hierarchy)
    return '\033[93m%s\033[91m   (%s)\033[0m' % (interface_id, hierarchy)
Ejemplo n.º 2
0
def list_interfaces():
    catalog = Catalog()

    print '=========='
    print 'Interfaces'
    print '=========='

    for interface_id in sorted(catalog.interfaces()):
        interface = catalog.interface(interface_id)
        print color_interface_line(interface_id)
        print '       defined in:', interface.__module__
        print
    print
Ejemplo n.º 3
0
def list_interfaces():
    catalog = Catalog()

    print '=========='
    print 'Interfaces'
    print '=========='

    for interface_id in sorted(catalog.interfaces()):
        interface = catalog.interface(interface_id)
        print color_interface_line(interface_id)
        print '       defined in:', interface.__module__
        print
    print
Ejemplo n.º 4
0
def color_interface_line(interface_id):
        catalog = Catalog()
        interface = catalog.interface(interface_id)
        hierarchy = [cl.__name__ for cl in reversed(inspect.getmro(interface)) if cl in catalog._interfaces.values()]
        hierarchy = ' > '.join(hierarchy)
        return '\033[93m%s\033[91m   (%s)\033[0m' % (interface_id, hierarchy)