[geneagrapher] 139/226: Updated string formatting to newer syntax.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sat Jul 11 17:10:55 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 8dede37d392d466bd4059be0ee6b6a1c8d3f09a5
Author: David Alber <alber.david at gmail.com>
Date:   Fri Sep 2 23:22:46 2011 -0700

    Updated string formatting to newer syntax.
---
 geneagrapher/GGraph.py       | 6 +++---
 geneagrapher/geneagrapher.py | 6 +++---
 geneagrapher/grab.py         | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/geneagrapher/GGraph.py b/geneagrapher/GGraph.py
index e5452d7..b61d1c5 100644
--- a/geneagrapher/GGraph.py
+++ b/geneagrapher/GGraph.py
@@ -188,7 +188,7 @@ class Graph:
         is not already present.
         """
         if node.id() is not None and self.hasNode(node.id()):
-            msg = "node with id %d already exists" % (node.id())
+            msg = "node with id {} already exists".format(node.id())
             raise DuplicateNodeError(msg)
         if node.id() is None:
             # Assign a "dummy" id.
@@ -240,13 +240,13 @@ class Graph:
                 queue += node.descendants
         
             # Print this node's information.
-            nodestr = "    %d [label=\"%s\"];" % (node_id, node)
+            nodestr = "    {} [label=\"{}\"];".format(node_id, node)
             dotfile += nodestr
 
             # Store the connection information for this node.
             for advisor in node.ancestors:
                 if self.hasNode(advisor):
-                    edgestr = "\n    %d -> %d;" % (advisor, node_id)
+                    edgestr = "\n    {} -> {};".format(advisor, node_id)
                     edges += edgestr
                 
             dotfile += "\n"
diff --git a/geneagrapher/geneagrapher.py b/geneagrapher/geneagrapher.py
index 688e696..4f6cadc 100644
--- a/geneagrapher/geneagrapher.py
+++ b/geneagrapher/geneagrapher.py
@@ -64,7 +64,7 @@ class Geneagrapher:
 				# Then this information has not yet been grabbed.
 				grabber = grab.Grabber(id)
 				if self.verbose:
-					print "Grabbing record #%d" % (id)
+					print "Grabbing record #{}".format(id)
 				try:
 					[name, institution, year, advisors, descendants] = grabber.extractNodeInformation()
 				except ValueError:
@@ -84,7 +84,7 @@ class Geneagrapher:
 					# Then this information has not yet been grabbed.
 					grabber = grab.Grabber(id)
 					if self.verbose:
-						print "Grabbing record #%d" % (id)
+						print "Grabbing record #{}".format(id)
 					try:
 						[name, institution, year, advisors, descendants] = grabber.extractNodeInformation()
 					except ValueError:
@@ -101,7 +101,7 @@ class Geneagrapher:
 					# Then this information has not yet been grabbed.
 					grabber = grab.Grabber(id)
 					if self.verbose:
-						print "Grabbing record #%d" % (id)
+						print "Grabbing record #{}".format(id)
 					try:
 						[name, institution, year, advisors, descendants] = grabber.extractNodeInformation()
 					except ValueError:
diff --git a/geneagrapher/grab.py b/geneagrapher/grab.py
index 336b62c..766e3cb 100644
--- a/geneagrapher/grab.py
+++ b/geneagrapher/grab.py
@@ -47,7 +47,7 @@ class Grabber:
         
         if psarray[0].find("You have specified an ID that does not exist in the database. Please back up and try again.") > -1:
             # Then a bad URL (e.g., a bad record id) was given. Throw an exception.
-            msg = "Invalid page address for id %d" % (self.id)
+            msg = "Invalid page address for id {}".format(self.id)
             raise ValueError(msg)
 
         lines = iter(psarray)

-- 
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