Catch shutil.copy error

svn: r662
This commit is contained in:
Don Allingham 2001-12-25 04:59:24 +00:00
parent 3e59f54102
commit 6a74514133

View File

@ -310,34 +310,37 @@ class IndividualPage:
self.doc.start_table("gallery","IndTable") self.doc.start_table("gallery","IndTable")
for obj in my_list: for obj in my_list:
self.doc.start_row() try:
self.doc.start_cell("ImageCell") shutil.copy(src,"%s/images/%s" % (self.dir,base))
self.doc.start_paragraph("Data") self.doc.start_row()
src = obj.getReference().getPath() self.doc.start_cell("ImageCell")
base = os.path.basename(src) self.doc.start_paragraph("Data")
self.doc.start_link("images/%s" % base) src = obj.getReference().getPath()
self.doc.add_photo(src,"row",1.5,1.5) base = os.path.basename(src)
shutil.copy(src,"%s/images/%s" % (self.dir,base)) self.doc.start_link("images/%s" % base)
self.doc.end_link() self.doc.add_photo(src,"row",1.5,1.5)
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)
self.doc.end_paragraph() self.doc.end_paragraph()
if obj.getNote() != "": self.doc.end_cell()
self.doc.start_paragraph("PhotoNote") self.doc.start_cell("NoteCell")
self.doc.write_text(obj.getNote()) description = obj.getReference().getDescription()
self.doc.end_paragraph() if description != "":
elif obj.getReference().getNote() != "": self.doc.start_paragraph("PhotoDescription")
self.doc.start_paragraph("PhotoNote") self.doc.write_text(description)
self.doc.write_text(obj.getReference().getNote()) self.doc.end_paragraph()
self.doc.end_paragraph() if obj.getNote() != "":
self.doc.end_cell() self.doc.start_paragraph("PhotoNote")
self.doc.end_row() 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() self.doc.end_table()