( entry )
| 24 | # entry == the form dictionary |
| 25 | # book == the guestbook file |
| 26 | def bookEntry( entry ): |
| 27 | book = open( book_file_name, 'a') |
| 28 | book.write( '<TR><TD COLSPAN="2"><B>%s</B>' % entry['name'].value ) |
| 29 | book.write( ''' |
| 30 | <HR WIDTH="100%"><BR> |
| 31 | </TD></TR> |
| 32 | <TR><TD VALIGN="TOP" ALIGN="RIGHT"> |
| 33 | ''' ) |
| 34 | if entry.has_key('email'): |
| 35 | email = entry['email'].value |
| 36 | book.write( '<A HREF="mailto:%s">\n %s\n</A>' % (email,email) ) |
| 37 | book.write( ' \n<BR>\n' ) |
| 38 | if entry.has_key('website'): |
| 39 | website = entry['website'].value |
| 40 | book.write( '<A HREF="http://%s">\n %s\n</A>' % (website,website) ) |
| 41 | book.write( ' \n' ) |
| 42 | book.write( '</TD><TD VALIGN="TOP">\n%s\n</TD></TR>\n' %entry['message'].value ) |
| 43 | book.write( '<TR><TD><BR></TD></TR>\n\n\n' ) |
| 44 | book.close() # This line was changed from the April 30 version |
| 45 | |
| 46 | |
| 47 | ################### |
no test coverage detected