From 5d176c702f46d80ea464e505e1427751a4642dc7 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 6 Jan 2003 05:35:30 +0000 Subject: [PATCH] Convert OpenDrawDoc to use zipfile svn: r1240 --- src/docgen/OpenDrawDoc.py | 51 +++++++++++++++++------------------- src/plugins/AncestorChart.py | 3 ++- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/src/docgen/OpenDrawDoc.py b/src/docgen/OpenDrawDoc.py index bf9cdca1e..d37982af3 100644 --- a/src/docgen/OpenDrawDoc.py +++ b/src/docgen/OpenDrawDoc.py @@ -21,6 +21,8 @@ import os import tempfile import string +import zipfile + import Plugins from intl import gettext as _ @@ -53,14 +55,9 @@ class OpenDrawDoc(DrawDoc): self.filename = filename tempfile.tempdir = "/tmp" - self.tempdir = tempfile.mktemp() - os.mkdir(self.tempdir,0700) - os.mkdir(self.tempdir + os.sep + "Pictures") - os.mkdir(self.tempdir + os.sep + "META-INF") + self.content_xml = tempfile.mktemp() + self.f = open(self.content_xml,"wb") - fname = self.tempdir + os.sep + "content.xml" - self.f = open(fname,"wb") - self.f.write('\n') self.f.write('\n') self.f.write('\n') self.f.write('') @@ -361,9 +358,9 @@ class OpenDrawDoc(DrawDoc): self.f.close() def _write_meta_file(self): - file = self.tempdir + os.sep + "meta.xml" name = self.name - self.f = open(file,"wb") + self.meta_xml = tempfile.mktemp() + self.f = open(self.meta_xml,"wb") self.f.write('\n') self.f.write('