[geneagrapher] 160/226: Removed already_printed member from Node.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Sat Jul 11 17:10:59 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository geneagrapher.
commit fa50db9abc6ea3339718855d6c838dc034de9dc7
Author: David Alber <alber.david at gmail.com>
Date: Mon Oct 31 21:58:53 2011 -0700
Removed already_printed member from Node.
---
geneagrapher/graph/graph.py | 10 +++++-----
geneagrapher/graph/node.py | 3 +--
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/geneagrapher/graph/graph.py b/geneagrapher/graph/graph.py
index 8d53550..34d4222 100644
--- a/geneagrapher/graph/graph.py
+++ b/geneagrapher/graph/graph.py
@@ -103,17 +103,17 @@ class Graph:
node [shape=plaintext];
edge [style=bold];\n\n"""
+ printed_nodes = {}
while len(queue) > 0:
node_id = queue.pop()
if not self.has_node(node_id):
# Skip this id if a corresponding node is not present.
continue
- node = self.get_node(node_id)
-
- if node.already_printed:
+ if printed_nodes.has_key(node_id):
+ # Skip this id because it is already printed.
continue
- else:
- node.already_printed = True
+ node = self.get_node(node_id)
+ printed_nodes[id] = node
if include_ancestors:
# Add this node's advisors to queue.
diff --git a/geneagrapher/graph/node.py b/geneagrapher/graph/node.py
index 3c11d67..bd26fcf 100644
--- a/geneagrapher/graph/node.py
+++ b/geneagrapher/graph/node.py
@@ -19,7 +19,6 @@ class Node:
self.record = record
self.ancestors = ancestors
self.descendants = descendants
- self.already_printed = False
# Verify parameter types.
if not isinstance(self.record, Record):
@@ -59,7 +58,7 @@ class Node:
"""
return self.record.id
- def set_id(self, id):
+ def set_id(self, id): # NOTE: is this used?
"""
Sets the record id.
"""
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/geneagrapher.git
More information about the debian-science-commits
mailing list