diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-06 18:13:21 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-06 18:13:21 +0200 |
commit | b3cde0ee162b8f0cb67da981311c8f9c16050a62 (patch) | |
tree | 537615b8d7cfd059b2d7938a1929d9e3199fb374 /lib/git/async/graph.py | |
parent | ec28ad575ce1d7bb6a616ffc404f32bbb1af67b2 (diff) | |
download | gitpython-b3cde0ee162b8f0cb67da981311c8f9c16050a62.tar.gz |
First step of testing the pool - tasks have been separated into a new module including own tests, their design improved to prepare them for some specifics that would be needed for multiprocessing support
Diffstat (limited to 'lib/git/async/graph.py')
-rw-r--r-- | lib/git/async/graph.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/git/async/graph.py b/lib/git/async/graph.py index b4d6aa00..d817eeb4 100644 --- a/lib/git/async/graph.py +++ b/lib/git/async/graph.py @@ -1,14 +1,20 @@ """Simplistic implementation of a graph""" class Node(object): - """A quick and dirty to the point implementation of a simple, and slow ascyclic graph. - Its not designed to support big graphs, and sports only the functionality - we need""" - __slots__ = ('in_nodes', 'out_nodes') + """A Node in the graph. They know their neighbours, and have an id which should + resolve into a string""" + __slots__ = ('in_nodes', 'out_nodes', 'id') - def __init__(self): + def __init__(self, id=None): + self.id = id self.in_nodes = list() self.out_nodes = list() + + def __str__(self): + return str(self.id) + + def __repr__(self): + return "%s(%s)" % (type(self).__name__, self.id) class Graph(object): |