From 6a74514133465f6a53016c1561e5e1de32e6a313 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 25 Dec 2001 04:59:24 +0000 Subject: [PATCH] Catch shutil.copy error svn: r662 --- src/plugins/WebPage.py | 57 ++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/plugins/WebPage.py b/src/plugins/WebPage.py index 393b37513..840e8d51b 100644 --- a/src/plugins/WebPage.py +++ b/src/plugins/WebPage.py @@ -310,34 +310,37 @@ class IndividualPage: self.doc.start_table("gallery","IndTable") for obj in my_list: - self.doc.start_row() - self.doc.start_cell("ImageCell") - self.doc.start_paragraph("Data") - src = obj.getReference().getPath() - base = os.path.basename(src) - self.doc.start_link("images/%s" % base) - self.doc.add_photo(src,"row",1.5,1.5) - shutil.copy(src,"%s/images/%s" % (self.dir,base)) - self.doc.end_link() - - self.doc.end_paragraph() - self.doc.end_cell() - self.doc.start_cell("NoteCell") - description = obj.getReference().getDescription() - if description != "": - self.doc.start_paragraph("PhotoDescription") - self.doc.write_text(description) + try: + shutil.copy(src,"%s/images/%s" % (self.dir,base)) + self.doc.start_row() + self.doc.start_cell("ImageCell") + self.doc.start_paragraph("Data") + src = obj.getReference().getPath() + base = os.path.basename(src) + self.doc.start_link("images/%s" % base) + self.doc.add_photo(src,"row",1.5,1.5) + self.doc.end_link() + self.doc.end_paragraph() - if obj.getNote() != "": - self.doc.start_paragraph("PhotoNote") - self.doc.write_text(obj.getNote()) - self.doc.end_paragraph() - elif obj.getReference().getNote() != "": - self.doc.start_paragraph("PhotoNote") - self.doc.write_text(obj.getReference().getNote()) - self.doc.end_paragraph() - self.doc.end_cell() - self.doc.end_row() + self.doc.end_cell() + self.doc.start_cell("NoteCell") + description = obj.getReference().getDescription() + if description != "": + self.doc.start_paragraph("PhotoDescription") + self.doc.write_text(description) + self.doc.end_paragraph() + if obj.getNote() != "": + self.doc.start_paragraph("PhotoNote") + self.doc.write_text(obj.getNote()) + self.doc.end_paragraph() + elif obj.getReference().getNote() != "": + self.doc.start_paragraph("PhotoNote") + self.doc.write_text(obj.getReference().getNote()) + self.doc.end_paragraph() + self.doc.end_cell() + self.doc.end_row() + except IOError: + pass self.doc.end_table()