Commit f64805a9 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update ui_viewport to remove obsolete code.

parent e9e45161
......@@ -35,11 +35,7 @@ class ViewportUi(object):
ViewportUi.object_node(db, T),
ViewportUi.event_node(db, T),
ViewportUi.list_node(db, T, selector_panel),
ViewportUi.list2_node(db, T, selector_panel),
ViewportUi.metric1d_node(db, T, selector_panel),
ViewportUi.metric2d_node(db, T, selector_panel),
ViewportUi.metric2d2_node(db, T, selector_panel),
ViewportUi.graph_node(db, T, selector_panel)]
ViewportUi.metric2d_node(db, T, selector_panel)]
modifier = dbui.ViewportModifier()
modifier.add_node(*nodes)
......@@ -137,12 +133,8 @@ class ViewportUi(object):
node = Node(T("Configure"))
add_child = node.add_child
add_child(T("the lists"), to_grid(db.lists))
add_child(T("the lists #2"), to_grid(db.lists2))
add_child(T("the metrics 1d"), to_grid(db.metrics1d))
add_child(T("the metrics 2d"), to_grid(db.metrics2d))
add_child(T("the metrics 2d2"), to_grid(db.metrics2d2))
add_child(T("the graphs"), to_grid(db.graphs))
add_child(T("the lists"), to_grid(db.lists2))
add_child(T("the metrics 2d"), to_grid(db.metrics2d2))
return node
......@@ -243,34 +235,6 @@ class ViewportUi(object):
add_child = node.add_child
for row in db(db.lists.id > 0).select(orderby=db.lists.name):
panel = selector_panel
panel.baseUrl = URL("plugin_event", "grid")
panel.baseParams = {"id_lists": row.id}
add_child(row.name, panel)
return node
@staticmethod
def list2_node(db, T, selector_panel):
"""To deal with lists.
Args:
db (pyDAL.DAL): database connection
T (gluon.languages.translator): language translator
selector_panel (gluon.storage.Storage):
configuration of the selector panel.
Returns:
dbui.Node:
the configuration of a tree node.
"""
node = Node(T("The lists #2"))
add_child = node.add_child
for row in db(db.lists2.id > 0).select(orderby=db.lists2.name):
panel = selector_panel
......@@ -281,64 +245,8 @@ class ViewportUi(object):
return node
@staticmethod
def metric1d_node(db, T, selector_panel):
"""To deal with one-dimension metrics.
Args:
db (pyDAL.DAL): database connection
T (gluon.languages.translator): language translator
selector_panel (gluon.storage.Storage):
configuration of the selector panel.
Returns:
dbui.Node:
the configuration of a tree node.
"""
node = Node(T("The metrics 1d"))
add_child = node.add_child
for row in db(db.metrics1d.id > 0).select(orderby=db.metrics1d.name):
panel = selector_panel
panel.baseUrl = URL("plugin_event", "grid")
panel.baseParams = {"id_metrics1d": row.id}
add_child(row.name, panel)
return node
@staticmethod
def metric2d_node(db, T, selector_panel):
"""To deal wiht two-dimension metrics.
Args:
db (pyDAL.DAL): database connection
T (gluon.languages.translator): language translator
selector_panel (gluon.storage.Storage):
configuration of the selector panel.
Returns:
dbui.Node:
the configuration of a tree node.
"""
node = Node(T("The metrics 2d"))
add_child = node.add_child
for row in db(db.metrics2d.id > 0).select(orderby=db.metrics2d.name):
panel = selector_panel
panel.baseUrl = URL("plugin_event", "grid")
panel.baseParams = {"id_metrics2d": row.id}
add_child(row.name, panel)
return node
@staticmethod
def metric2d2_node(db, T, selector_panel):
"""To deal with two-dimension metrics.
Args:
......@@ -351,7 +259,7 @@ class ViewportUi(object):
dbui.Node:
the configuration of a tree node.
"""
node = Node(T("The metrics 2d2"))
node = Node(T("The metrics 2d"))
add_child = node.add_child
......@@ -364,29 +272,3 @@ class ViewportUi(object):
add_child(row.name, panel)
return node
@staticmethod
def graph_node(db, T, selector_panel):
"""To deal with graphs.
Args:
db (pyDAL.DAL): database connection
T (gluon.languages.translator): language translator
selector_panel (gluon.storage.Storage):
configuration of the selector panel.
Returns:
dbui.Node:
the configuration of a tree node.
"""
node = Node(T("The graphs"))
for row in db(db.graphs.id > 0).select(orderby=db.graphs.name):
panel = selector_panel
panel.baseUrl = URL("plugin_event", "graph_mpl")
panel.baseParams = {"id_graphs": row.id}
node.add_child(row.name, panel)
return node
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment