Commit c7fe00fd authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

* src/graph/graph.cc: fix reset filter when it's not enabled

* src/graph-tool allow for parameter setting before loading property editing script


git-svn-id: https://svn.forked.de/graph-tool/trunk@74 d4600afd-f417-0410-95de-beed9576f240
parent a5935300
......@@ -768,7 +768,12 @@ def parse_option(opt, just_file=False):
return None
edit_vars = dict()
if "file:" in values[1]:
exec open(values[1].replace("file:","").strip()).read() in edit_vars
expressions = values[1].split("file:")
if len(expressions) > 1:
exec expressions[0] in edit_vars
exec open(expressions[1].strip()).read() in edit_vars
else:
exec open(expressions[0].strip()).read() in edit_vars
edit_function = edit_vars["edit_function"]
else:
def edit_function():
......
......@@ -119,7 +119,8 @@ void GraphInterface::SetVertexFilterProperty(string property)
}
}
#else
throw GraphException("support for graph range filtering was not enabled during compilation.");
if (property != "")
throw GraphException("support for graph range filtering was not enabled during compilation.");
#endif
}
......@@ -156,7 +157,8 @@ void GraphInterface::SetEdgeFilterProperty(string property)
}
#else
throw GraphException("support for graph range filtering was not enabled during compilation.");
if (property != "")
throw GraphException("support for graph range filtering was not enabled during compilation.");
#endif
}
......@@ -177,7 +179,8 @@ void GraphInterface::SetGenericVertexFilter(boost::python::object filter)
#ifndef NO_PYTHON_FILTERING
_vertex_python_filter = filter;
#else
throw GraphException("support for graph python filtering was not enabled during compilation.");
if (filter != python::object())
throw GraphException("support for graph python filtering was not enabled during compilation.");
#endif
}
......@@ -186,7 +189,8 @@ void GraphInterface::SetGenericEdgeFilter(boost::python::object filter)
#ifndef NO_PYTHON_FILTERING
_edge_python_filter = filter;
#else
throw GraphException("support for graph python filtering was not enabled during compilation.");
if (filter != python::object())
throw GraphException("support for graph python filtering was not enabled during compilation.");
#endif
}
......
Supports Markdown
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