write_message("('%s', '%s', '%s', '%s', '%s', '%s', '%s') not inserted because format already exists (%s)."%(url,format,docname,doctype,newname,description,comment,e),stream=sys.stderr)
raise
finally:
os.remove(tmpurl)
exceptException,e:
write_message("Error in downloading '%s' because of: %s"%(url,e),stream=sys.stderr)
write_message('Just updating description and comment for %s with format %s with description %s and comment %s'%(docname,format,description,comment),verbose=9)
try:
bibdoc.set_description(description,format)
bibdoc.set_comment(comment,format)
exceptStandardError,e:
write_message("('%s', '%s', '%s', '%s') description and comment not updated because '%s'."%(docname,format,description,comment,e))
raise
returnTrue
def_add_new_icon(bibdoc,url,restriction):
"""Adds a new icon to an existing bibdoc, replacing the previous one if it exists. If url is empty, just remove the current icon."""