[Pywikipedia-l] SVN: [6605] trunk/pywikipedia/interwiki_graph.py

nicdumz at svn.wikimedia.org nicdumz at svn.wikimedia.org
Tue Apr 14 16:55:58 UTC 2009


Revision: 6605
Author:   nicdumz
Date:     2009-04-14 16:55:58 +0000 (Tue, 14 Apr 2009)

Log Message:
-----------
[1999787] "InvocationException in interwiki_graph.py"
See http://www.graphviz.org/doc/info/lang.html : 
dot does not allow ':' in alphanumeric IDs. The only way to include those
is to pass to dot a double quoted string.

Credits go to mpupat for tracking down the issue

Modified Paths:
--------------
    trunk/pywikipedia/interwiki_graph.py

Modified: trunk/pywikipedia/interwiki_graph.py
===================================================================
--- trunk/pywikipedia/interwiki_graph.py	2009-04-14 16:05:46 UTC (rev 6604)
+++ trunk/pywikipedia/interwiki_graph.py	2009-04-14 16:55:58 UTC (rev 6605)
@@ -46,11 +46,11 @@
         self.subject = subject
 
     def getLabel(self, page):
-        return (u'"%s:%s"' % (page.site().language(), page.title())).encode('utf-8')
+        return (u'"\"%s:%s\""' % (page.site().language(), page.title())).encode('utf-8')
 
     def addNode(self, page):
         node = pydot.Node(self.getLabel(page), shape = 'rectangle')
-        node.set_URL('http://%s%s' % (page.site().hostname(), page.site().get_address(page.urlname())))
+        node.set_URL("\"http://%s%s\"" % (page.site().hostname(), page.site().get_address(page.urlname())))
         node.set_style('filled')
         node.set_fillcolor('white')
         node.set_fontsize('11')





More information about the Pywikipedia-l mailing list