Ejemplo n.º 1
0
def display_page(pathname):
    """

    Args:
      pathname: 

    Returns:

    """

    path_info = parse_path(pathname)

    if path_info:
        if path_info['mode'] == 'model':
            if path_info['value']:
                return model_layout(path_info['value'])
            else:
                return models_index
        elif path_info['mode'] == 'property':
            if path_info['value']:
                property_name = path_info['value']
                return property_layout(property_name)
            else:
                return properties_index()
        elif path_info['mode'] == 'load_material':
            return material_layout
        else:
            return '404'
    else:
        return index
Ejemplo n.º 2
0
def hightlight_node_for_content(pathname):
    """

    Args:
      pathname: 

    Returns:

    """
    path_info = parse_path(pathname)
    if path_info and path_info['value']:
        return path_info['value']
    else:
        return 'none'
Ejemplo n.º 3
0
def display_page(pathname, search):
    """

    Args:
      pathname:
      search:

    Returns:

    """

    path_info = parse_path(pathname, search)

    if path_info:
        if path_info['mode'] == 'model':
            if path_info['value']:
                return model_layout(path_info['value'])
            else:
                return models_index
        elif path_info['mode'] == 'property':
            if path_info['value']:
                property_name = path_info['value']
                return symbol_layout(property_name)
            else:
                return symbols_index()
        elif path_info['mode'] == 'explore':
            return EXPLORE_LAYOUT
        elif path_info['mode'] == 'plot':
            props = None
            if path_info['value'] is not None:
                props = path_info['value']
            return get_plot_layout(props)
        elif path_info['mode'] == 'generate':
            return INTERACTIVE_LAYOUT
        elif path_info['mode'] == 'correlate':
            return CORRELATE_LAYOUT
        elif path_info['mode'] == 'refs':
            return REFS_LAYOUT
        elif path_info['mode'] == 'home':
            return home_layout()
        else:
            return '404'
    else:
        return home_layout()
Ejemplo n.º 4
0
def display_page(pathname):
    """

    Args:
      pathname:

    Returns:

    """

    path_info = parse_path(pathname)

    if path_info:
        if path_info['mode'] == 'model':
            if path_info['value']:
                return model_layout(path_info['value'])
            else:
                return models_index
        elif path_info['mode'] == 'property':
            if path_info['value']:
                property_name = path_info['value']
                return symbol_layout(property_name)
            else:
                return symbols_index()
        elif path_info['mode'] == 'explore':
            return EXPLORE_LAYOUT
        elif path_info['mode'] == 'plot':
            return PLOT_LAYOUT
        elif path_info['mode'] == 'generate':
            return INTERACTIVE_LAYOUT
        elif path_info['mode'] == 'home':
            return home_layout()
        else:
            return '404'
    else:
        return home_layout()
Ejemplo n.º 5
0
def display_page(pathname):
    """

    Args:
      pathname:

    Returns:

    """

    path_info = parse_path(pathname)

    if path_info:
        if path_info['mode'] == 'model':
            if path_info['value']:
                return model_layout(path_info['value'])
            else:
                return models_index
        elif path_info['mode'] == 'property':
            if path_info['value']:
                property_name = path_info['value']
                return symbol_layout(property_name)
            else:
                return symbols_index()
        elif path_info['mode'] == 'load_material':
            return material_layout
        elif path_info['mode'] == 'graph':
            return graph_layout
        elif path_info['mode'] == 'ashby':
            return ASHBY_LAYOUT
        elif path_info['mode'] == 'interactive':
            return INTERACTIVE_LAYOUT
        else:
            return '404'
    else:
        return index