def edit_personal(book, person_name, connection): name_parse = person_name.split('_') name = name_parse[0] + ' ' + name_parse[1] person = book.find_person_by_name(name_parse[0], name_parse[1]) doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n' style = html.Element('<style>', 'sup {color: red}') edit = html.Element('<html>', str(html.header('Edit ' + name, style) + str(html.add_and_edit('edit', person)))) connection.sendall(doctype + str(edit))
def create_personal(book, person_name, connection): name_parse = person_name.split('_') name = name_parse[0] + ' ' + name_parse[1] person = book.find_person_by_name(name_parse[0], name_parse[1]) doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n' personal = html.Element('<html>', str(html.header(name) + str(html.personal(person)))) connection.sendall(doctype + str(personal))
def create_add(connection): doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n' style = html.Element('<style>', 'sup {color: red}') add = html.Element('<html>', str(html.header('Add Person', style) + str(html.add_and_edit('add')))) connection.sendall(doctype + str(add))
def create_del(book, connection): doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n' style = html.Element('<style>', 'ul {list-style-type: none; text-align:left;}') delete = html.Element('<html>', str(html.header('Delete Person', style) + str(html.delete(book)))) connection.sendall(doctype + str(delete))
def create_index(book, connection): doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n' style = html.Element('<style>', 'ul {list-style-type: none; text-align:center;}') index = html.Element('<html>', str(html.header('Address Book', style) + str(html.index(book)))) connection.sendall(doctype + str(index))