[entropy.graph] add get_node() method to Graph

This commit is contained in:
Fabio Erculiani
2009-12-12 16:59:49 +01:00
parent d19788b72a
commit 299c19962b
+12
View File
@@ -346,6 +346,18 @@ class Graph(object):
"""
self.__graph_map_cache = None
def get_node(self, item):
"""
Return GraphNode instance for added item (through add())
@param item: Python object to be added to the graph
@type item: Python object
@return: GraphNode instance bound to item
@rtype: entropy.graph.GraphNode
@raise KeyError: if item is not in Graph
"""
return self.__graph[item]
def add(self, item, dependency_items):
"""
Add arbitrary object to Graph, specifying its dependencies.