示例#1
0
文件: tools.py 项目: shiva16/openalea
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)
示例#2
0
文件: tools.py 项目: shiva16/openalea
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
示例#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
示例#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)