From 299c19962b9cd4cac78aeea807d9ee707dad3ad7 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 12 Dec 2009 16:59:49 +0100 Subject: [PATCH] [entropy.graph] add get_node() method to Graph --- libraries/entropy/graph.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libraries/entropy/graph.py b/libraries/entropy/graph.py index 5ea7234eb..5afdd57e9 100644 --- a/libraries/entropy/graph.py +++ b/libraries/entropy/graph.py @@ -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.