summaryrefslogtreecommitdiff
path: root/graph.py
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2008-08-20 11:14:29 +0200
committerEmile Anclin <emile.anclin@logilab.fr>2008-08-20 11:14:29 +0200
commit8edbfa73b1d84ab61ee2d843aaa6a3aa19904927 (patch)
treeca967298d657fc1617793abbc42cb46d7d573e8c /graph.py
parent6b11efeccabd730681ea4cf015c732dda007d8d9 (diff)
downloadlogilab-common-8edbfa73b1d84ab61ee2d843aaa6a3aa19904927.tar.gz
put dotsource in /tmp to avoid deleting a dotfile previously in storedir
Diffstat (limited to 'graph.py')
-rw-r--r--graph.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/graph.py b/graph.py
index c340655..50d2bbe 100644
--- a/graph.py
+++ b/graph.py
@@ -78,7 +78,9 @@ class DotBackend:
outputfile = osp.join(storedir, basename)
dotfile = dotfile or ('%s.dot' % self.graphname)
dot_sourcepath = osp.join(storedir, dotfile)
- pdot = file(dot_sourcepath, 'w')
+ if target != 'dot':
+ dot_sourcepath = osp.join('/tmp', dotfile)
+ pdot = open(dot_sourcepath, 'w')
if isinstance(self.source, unicode):
pdot.write(self.source.encode('UTF8'))
else: