From feb6620cf8e9116cab6a286820f7ca89fde9e58c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Wed, 7 Jun 2006 13:00:36 +0000 Subject: [PATCH] * fix: id strings in graphviz can't have any punctuation chars it seems --- pisi/graph.py | 10 ++++++++-- pisi/pgraph.py | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pisi/graph.py b/pisi/graph.py index 65386e19..ffc15396 100644 --- a/pisi/graph.py +++ b/pisi/graph.py @@ -13,6 +13,8 @@ import sys +import string + import pisi import gettext @@ -143,8 +145,12 @@ class Digraph(object): return list def id_str(self, u): - s = str(u) - return s.replace('-', '_') + def repl(char): + if char in string.punctuation: + return '_' + else: + return char + return pisi.util.concat(map(repl, str(u))) def write_graphviz(self, f): f.write('digraph G {\n') diff --git a/pisi/pgraph.py b/pisi/pgraph.py index dee7a9e6..d36b43e9 100644 --- a/pisi/pgraph.py +++ b/pisi/pgraph.py @@ -10,7 +10,9 @@ # Please read the COPYING file. # -# PISI package relation graph that represents the state of packagedb +"""PISI package relation graph that represents the state of packagedb""" + +import string from graph import *