5 from string import Template
10 link_Template= Template(\
11 "<a href = http://www.chiark.greenend.org.uk/ucgi/~naath/$script"\
12 +" title=$title>$text</a>")
21 def print_row(row,newLine):
24 out = out + str(item)+'|'
25 return out[:-1] + newLine
27 def print_query(s,t,newLine):
29 for row in run_query(s,t):
30 printMe = printMe + print_row(row,newLine)
40 def print_tagged_query(relationship,s,t,newLine):
42 for row in run_query(s,t):
43 mine = mine + print_tagged_name(relationship,row,newLine)
47 def relationship_html(ID,ID2,newLine):
49 relationship = common_ancestors(ID,ID2,newLine)[2]
51 if relationship[-11:] != 'not related':
52 script = "ancestors.py?ID="+str(ID)+"&ID2="+str(ID2)
53 url = link_Template.substitute\
54 (script = script,title = "Common ancestors"\
55 ,text = "Common ancestors")
56 return relationship + ' '+url + newLine
58 return relationship + newLine
62 def terr_html(terr,newLine,start,stop):
64 if start == 0 and stop ==0:
65 myTitle = add_quotes(terr)
68 s = "SELECT name,people.id"\
69 +" FROM people INNER JOIN territories"\
70 +" ON people.id = territories.id"\
71 +" WHERE territory = ? AND stopyear <= ?"\
72 +" ORDER BY startyear DESC;"
76 for row in run_query(s,t):
77 myTitle = myTitle +"previous - " + row[0] \
81 u = "SELECT name,people.id"\
82 +" FROM people INNER JOIN territories"\
83 +" ON people.id = territories.id"\
84 +" WHERE territory = ? AND startyear >= ?"\
85 +" ORDER BY startyear;"
88 for r in run_query(u,v):
89 myTitle = myTitle + '
' +"next - " + r[0] \
93 myTitle = add_quotes(myTitle)
95 return link_Template.substitute(\
96 script = "territory.py?terr="+terr, title=myTitle,\
100 def name_html(row,html):
112 script = "person.py?ID=" + str(row[1])
114 return link_Template.substitute(script = script\
115 ,title = add_quotes(name),text = name)
117 return row[0] + "," +str(row[1])
125 def print_age_child_count(row,newLine):
126 if newLine == '<br>':
127 script = "listAge.py?age="+str(row[0])
128 link = link_Template.substitute(script = \
129 script, title = add_quotes(row[0]), text = row[0])
130 out = str(row[1])+print_people(row[1])
132 out = out + 'had children at age '+ link + newLine
135 return print_row(row,newLine)
137 def print_age_death_count(row,newLine):
139 script = "listAgeDeath.py?age="+str(row[0])
140 link = link_Template.substitute(script = script,\
141 title = add_quotes(row[0]),text = row[0])
142 out = str(row[1])+print_people(row[1])
143 out = out + "died at age " + link + newLine
146 return print_row(row,newLine)
148 def print_name_count(row,newLine):
150 script = "name.py?name=" + row[0]
151 link = link_Template.substitute(script =\
152 script, title = add_quotes(row[0]),text = row[0])
153 return str(row[1]) + " people called "+link + newLine
155 return print_row(row,newLine)
157 def print_children_count(row,newLine):
161 out = out + ' person '
163 out = out + ' people '
166 if newLine == '<br>':
167 script = "listChildCount.py?nc="+str(row[1])
168 link = link_Template.substitute(script =\
169 script, title = add_quotes(row[1]),text = row[1])
176 out = out + ' child '
178 out = out + ' children '
185 def print_tagged_name(relationship,row,newLine):
187 out = relationship + " not yet entered: " + row[1]
189 if newLine == '<br>':
193 if relationship =='':
194 out = name_html(row,html) + ' '
196 out = relationship + ": " + name_html(row,html)
199 def month_numbers(monthN):
201 month ='unknown month'
227 month = 'Incorrectly entered month ' + str(monthN)
230 def ordinal_numbers(number):
232 if number % 10==1 and number/10 % 10 !=1:
233 out = str(number) +'st'
234 elif number % 10==2 and number/10 % 10 !=1:
235 out = str(number) +'nd'
236 elif number % 10==3 and number/10 % 10 !=1:
237 out = str(number) +'rd'
239 out = str(number) +'th'
242 def list_territories(newLine):
243 s = "SELECT DISTINCT territory"\
244 +" FROM territories"\
245 +" ORDER BY territory;"
248 for row in run_query(s,()):
249 out =out + terr_html(row[0],newLine,0,0) +newLine
252 def list_people_parents():
253 s = "SELECT name,id"\
258 for row in run_query(s,()):
261 [parents, parentIDs,parentNames] = find_parents(ID)
262 [spouses,spousesID,spousesNames] = find_spouses(ID)
264 [self,myID,myName] = find_person(ID)
265 output.append([self,parents,spouses])
269 def list_people(newLine):
270 s = "SELECT name,id,bornyear"\
272 +" ORDER BY bornyear;"
276 out = out + 'born in unknown year:' +newLine
277 for row in run_query(s,()):
278 if row[2]!=0 and row[2]/100==0:
279 out = out +newLine+ 'born in 1st century:' +newLine
281 if row[2]/100!=year/100:
282 century = row[2]/100 + 1
283 out = out +newLine+ 'born in '
285 out = out +ordinal_numbers(century) \
286 + ' century:' + newLine
288 out = out + name_html(row,newLine) +newLine
290 if row[2] == 0: #unknown year
292 t = (row[1],) #person ID
296 u = "SELECT diedyear FROM people WHERE ID = ?;"
299 for r in run_query(u,t):
301 out = out + "died: "\
302 + str(r[0]) + newLine
303 bornAfter = r[0] -100
306 u = "Select people.bornYear from"\
307 +" people INNER JOIN parents"\
308 +" ON people.ID = parents.ID"\
309 +" WHERE parents.parentID = ?"\
310 + " ORDER BY people.bornYear;"
314 for r in run_query(u,t):
316 hadChild.append(r[0])
320 out = out + "had children in: "
322 out = out + str(c) + ','
323 out = out[:-1] + newLine
325 bornBefore = hadChild[0]-12
327 bornAfter = hadChild[0]-100
329 u = "Select styles.startYear, styles.style from"\
330 +" people INNER JOIN styles"\
331 +" ON people.ID = styles.ID"\
332 +" WHERE people.ID = ? and"\
333 +" styles.startYear <>0"\
334 +" ORDER BY styles.startYear;"
336 for r in run_query(u,t):
337 out = out + r[1] + " from " + str(r[0])\
340 bornAfter = r[0] -100
345 out = out + "probably born "\
346 +"after " + str(bornAfter)
348 out = out + "probably born "\
349 +"betwen " + str(bornAfter)\
350 +" and " + str(bornBefore)
356 def count_names(newLine):
357 s = "SELECT firstName, count(*)"\
359 +" GROUP BY firstName"\
360 +" ORDER BY count(*) DESC;"
363 for row in run_query(s,()):
364 out = out + print_name_count(row,newLine)
370 def count_children(newLine):
372 s = "SELECT count(*),nc"\
374 +" SELECT count(*) AS nc"\
376 +" GROUP BY parentID"\
377 +" HAVING parentID <>'?'"\
378 +" AND parentID <> '0')"\
382 for row in run_query(s,()):
383 out = out + print_children_count(row,newLine)
386 def parents_with_children(nChildren,newLine):
387 s = "SELECT name,parentID"\
389 + " LEFT JOIN people"\
390 + " ON parentID = people.ID"\
391 + " GROUP BY parentID"\
392 + " HAVING count(*) = ?"\
393 + " AND parentID <> 0"\
394 + " ORDER BY bornYear;"
397 u = "SELECT count(*)"\
398 +" FROM parents INNER JOIN people"\
399 +" ON parents.ID = people.ID"\
400 +" WHERE parentID = ?"\
401 +" AND (diedyear-bornyear>? OR died='present');"
403 out = "People who had " + str(nChildren)
407 out = out + " children"
408 out = out + ':' + newLine
412 for row in run_query(s,(nChildren,)):
413 out = out + name_html(row,newLine)
414 for r in run_query(u,(row[1],1)):
415 out += " %d survived infancy" % r[0]
416 for r in run_query(u,(row[1],18)):
417 out = out +" and " +str(r[0])+" survived to adulthood"
422 def search_name(name,newLine):
423 s = "SELECT name, ID"\
425 +" WHERE name LIKE ?;"
431 out = out + 'Names starting with ' + name + ':' + newLine
434 for row in run_query(s,t):
435 out = out + name_html(row,newLine) + newLine
436 fullIDs.append(row[1])
440 t = ('%' + name + '%',)
441 out = out+newLine + 'Names containing ' + name + ':' + newLine
442 for row in run_query(s,t):
443 if row[1] not in fullIDs:
444 out = out + name_html(row,newLine) + newLine
448 s = "SELECT name,people.ID,style"\
449 +" FROM people INNER JOIN styles"\
450 +" ON styles.id = people.id"\
451 +" WHERE style LIKE ?;"
452 out = out +newLine+ 'Styles containing ' + name + ':' + newLine
453 for row in run_query(s,t):
454 out = out + name_html(row,newLine)+' ' + row[2] + newLine
456 return [out,names,IDs]
459 def people_with_name(name,newLine):
460 s = "SELECT name, ID"\
462 +" WHERE firstname = ?;"
468 for row in run_query(s,t):
469 out = out + name_html(row,newLine) + newLine
473 def count_birth_month(newLine):
474 s = "SELECT bornMonth, count(*)"\
476 +" GROUP BY bornMonth"\
477 +" ORDER BY bornMonth;"
479 t = "SELECT * FROM people WHERE bornMonth = ?;"
482 for row in run_query(s,()):
483 month = month_numbers(row[0])
484 out = out + month + ': ' + str(row[1]) + newLine
488 out = out +print_query(t,u,newLine)
492 def count_death_month(newLine):
493 s = "SELECT diedMonth, count(*)"\
495 +" GROUP BY diedMonth"\
496 +" ORDER BY diedMonth;"
498 t = "SELECT * FROM people WHERE diedMonth = ?;"
501 for row in run_query(s,()):
502 month = month_numbers(row[0])
503 out = out + month + ': ' + str(row[1]) + newLine
507 out = out +print_query(t,u,newLine)
511 def count_age_at_child(newLine):
513 s = "select p1.bornYear - p2.bornYear as age, count(*)"\
515 +" parents INNER JOIN people p1"\
516 +" ON parents.ID = p1.ID"\
517 +" INNER JOIN people p2"\
518 +" ON parents.parentID = p2.ID"\
519 +" WHERE p1.bornYear <> 0 and p2.bornYear<>0"\
523 for row in run_query(s,()):
524 out = out + print_age_child_count(row,newLine)
528 def people_had_child_at_age(age,newLine):
530 s = "select p1.bornYear - p2.bornYear as age, p1.name, p1.ID"\
531 +",p2.name,p2.ID FROM"\
532 +" parents INNER JOIN people p1"\
533 +" ON parents.ID = p1.ID"\
534 +" INNER JOIN people p2"\
535 +" ON parents.parentID = p2.ID"\
536 +" WHERE age = ? AND p1.bornYear<>0 AND p2.bornYear<>0"
541 out = 'At age ' + str(age) + ' :'
542 for row in run_query(s,t):
544 out =out + name_html([row[3],row[4]],newLine) + ' had '\
545 +name_html([row[1],row[2]],newLine)
549 def count_age_at_death(newLine):
550 s = "select diedYear-bornYear as age,count(*)"\
552 +" WHERE diedYear<>0 AND bornYear<>0"\
555 for row in run_query(s,()):
556 out = out + print_age_death_count(row,newLine)
560 def people_died_at_age(age,newLine):
561 s = "SELECT diedYear-bornYear as age, name,ID"\
563 +" WHERE age = ? AND bornYear<>0 AND diedYear<>0;"
566 out = 'These people died at age ' +str(age) + ' :'
567 for row in run_query(s,t):
569 out = out + name_html([row[1],row[2]],newLine)
572 def all_ancestors(personID,newLine):
575 ancestors = [personID]
576 allAncestors = [personID]
580 t = "SELECT name,id FROM people WHERE id=?"
583 out = "Ancestors of "
584 for row in run_query(t,id):
585 out = out + name_html(row,newLine)+newLine
587 while len(ancestors)>0:
590 thisout = newLine + parent_level(level,'parent') +\
592 for ancestor in ancestors:
593 [parents, parentIDs,parentNames] \
594 = find_parents(ancestor)
595 for i in range(len(parents)):
596 r = [parentNames[i],parentIDs[i]]
597 thisout = thisout + \
598 name_html(r,newLine)+newLine
600 if r[1] not in allAncestors\
603 allAncestors.append(r[1])
604 trackLevel.append(level)
610 image = "<img src = ancestorGraph.py?id="+str(personID)+">"
611 out = out+newLine + image+newLine
612 return [out, allAncestors,trackLevel]
615 def common_ancestors(IDA, IDB,newLine):
616 out = 'Common ancestors of:' + newLine
618 s = "SELECT name,id FROM people WHERE id==?"
624 for row in run_query(s,t):
625 out = out + name_html(row,newLine)+newLine
632 related = 'No details held on one party'
634 return [out,[],related]
637 a = all_ancestors(IDA,newLine)
638 b = all_ancestors(IDB,newLine)
640 ancestorsB = set(b[1])
641 ancestorsA = set(a[1])
643 common = ancestorsA.intersection(ancestorsB)
644 common = list(common)
651 aLevels.append(a[2][i])
653 bLevels.append(b[2][i])
655 s = "SELECT Name, ID, bornyear"\
658 for i in range(len(common)):
662 s = s+") ORDER BY bornyear;"
666 related = names[0]+' and '+names[1]+' are not related'
667 out = out + newLine + related
668 return [out, common,related]
671 out = out + print_tagged_query('',s,common,newLine)
676 for i in range(len(common)):
677 if aLevels[i] == min(aLevels):
679 if bLevels[i] == min(bLevels):
684 s = "SELECT name, id"\
688 out = out + newLine + 'Most Recent Common Ancestors:' + newLine
692 mrca.append(common[a])
693 out = out + print_tagged_query('',s,t,newLine)
695 out = out + 'and' + newLine
697 out = out + parent_level(aLevels[indexA[0]],'parent')
701 out = out + ' of ' + name_html([names[0],IDA],newLine)+newLine
703 out = out + parent_level(bLevels[indexB[0]],'parent')
706 out = out + ' of ' + name_html([names[1],IDB],newLine)+newLine
709 al = aLevels[indexA[0]]
710 bl = bLevels[indexB[0]]
712 related = relationship(al,bl,names)
713 out = out+newLine + related
716 image = "<img src = jointAncestorGraph.py?id="+str(IDA)\
717 +"&id2="+str(IDB) + "&LA=" + str(min(aLevels)) \
718 +"&LB=" + str(min(bLevels))+">"
722 out = out+newLine + image+newLine
724 return [out,common,related]
726 def relationship(level1, level2,names):
728 if level1==0 and level2==0:
729 return names[0] + ' is ' +names[1]
731 return names[0] + ' is ' + names[1] + '\'s '+ parent_level(level2,'parent')
733 return names[1] + ' is ' + names[0] + '\'s '+ parent_level(level1,'parent')
737 remove = level1-level2
740 remove = level2-level1
744 uaLevel = parent_level(remove,'uncle or aunt')
746 return names[0] + ' is ' + names[1] + '\'s ' + uaLevel
749 return names[1] + ' is ' + names[0] + '\'s ' + uaLevel
751 c=ordinal_numbers(cousinNum)
757 rem = str(remove) + ' times'
759 r = names[0] +' and '+names[1] +' are ' + c + ' cousins '
761 r = r+ rem + ' removed'
765 def parent_level(level,type):
780 for i in range(2,level):
784 def rulers_of(aTerritory,newLine):
786 tq = "SELECT name, people.ID, startyear,stopyear,territory"\
787 +" FROM territories INNER JOIN people"\
788 +" ON people.ID = territories.ID"\
789 +" WHERE territory LIKE ?"\
790 +" ORDER BY territory,startyear,stopyear;"
797 for row in run_query(tq,(aTerritory+'%',)):
798 if row[4]!=last and last!='':
799 out = out + 'Rulers of '+terr_html(last,newLine,0,0) \
800 +':'+ newLine +thisT +newLine
803 thisT = thisT +name_html(row,newLine)
804 thisT = thisT +' from ' + str(row[2])+' to '+str(row[3]) + newLine
807 out = out + 'Rulers of '+terr_html(row[4],newLine,0,0) +':'+ \
813 s = "SELECT name || ','||ID, name, ID FROM people WHERE ID=?"
816 for row in run_query(s,t):
820 return [Self, selfID,selfName]
822 ID = int(ID.split(',')[-1])
823 s= "SELECT style FROM styles WHERE ID=?"
827 spellingsOfKing = ['King','Queen','king','queen']
828 for row in run_query(s,t):
829 for s in spellingsOfKing:
830 if re.match('.*'+s,row[0]) != None:
835 def find_parents(ID):
836 s = "SELECT name, parentID"\
837 +" FROM parents LEFT JOIN people"\
838 +" ON people.ID = parentID"\
839 +" WHERE parents.ID = ?;"
846 for row in run_query(s,t):
848 p = row[0] + ',' + str(row[1])
852 p = row[1] + ',p' + str(ID)
856 parentIDs.append(pID)
857 parentNames.append(pN)
859 if parents[1]==parents[0]:
860 parents[1] = parents[1] + ' 2'
862 return [parents,parentIDs,parentNames]
864 def find_spouses(ID):
867 order = [["IDb","IDa"],["IDa","IDb"]]
873 s = "SELECT name, marriages." + o[0]\
874 +" FROM marriages LEFT JOIN people"\
875 +" ON marriages." +o[0]+" = people.ID"\
876 +" WHERE marriages."+o[1]+" = ?;"
879 for row in run_query(s,t):
881 s = row[0] + "," +str(row[1])
885 s=row[1] + ",s" +str(ID)
890 spousesID.append(sID)
891 spousesNames.append(sN)
893 return [spouses,spousesID,spousesNames]
896 def find_children(ID):
897 s = "SELECT p1.name, p1.ID,p3.parentID,p4.name,p1.bornYear"\
899 +" INNER JOIN parents p2"\
900 +" ON p1.ID = p2.ID"\
901 +" INNER JOIN parents p3"\
902 +" ON p1.ID = p3.ID"\
903 +" LEFT JOIN people"\
904 +" p4 ON p3.parentID = p4.ID"\
905 +" WHERE p2.parentID = ?"\
906 +" AND p3.parentID<>?"\
907 +" ORDER BY p1.bornYear;"
916 for row in run_query(s,t):
917 c = row[0] + ',' + str(row[1])
921 childrenBorn.append(born)
923 op = row[3] + ',' + str(row[2])
927 op = row[2] + ',s' + str(ID)
932 IDs.append([cID,opID])
933 names.append([cName,opN])
935 return [nodes,IDs,names,childrenBorn]
937 def person_info(personID,newLine):
948 #Id, Name, Dates, Style, Style-Dates
949 s = "SELECT * FROM people WHERE ID = ?"
950 for row in run_query(s,t):
951 mainDiv = mainDiv + startP
952 mainDiv = mainDiv + 'ID: '+str(row[0]) +newLine
953 mainDiv = mainDiv + print_tagged_name('Name',[row[1], row[0]]\
955 mainDiv = mainDiv + endP
960 mainDiv = mainDiv + startP
961 mainDiv = mainDiv + newLine + 'Born: '+row[3] + newLine
963 mainDiv = mainDiv + 'Died: '+row[5]
965 if row[6] != 0 and row[4] !=0:
966 mainDiv = mainDiv + ", aged " \
968 mainDiv = mainDiv + endP
971 s = "SELECT * FROM styles WHERE ID = ?"
972 for row in run_query(s,t):
973 mainDiv = mainDiv + startP
974 mainDiv = mainDiv +newLine+ 'Style: '+row[1] + newLine
976 mainDiv = mainDiv + 'Territories:' + newLine
978 u = "SELECT * FROM territories"\
979 +" WHERE ID =? AND startYear =? AND stopYear=?"
980 v=(personID,row[3],row[5])
983 for r in run_query(u,v):
985 + terr_html(r[1],newLine,r[3],r[5])\
989 mainDiv = mainDiv[:-1] + newLine
991 mainDiv = mainDiv + 'From: '+row[2] + newLine
992 mainDiv = mainDiv + 'To: '+row[4]
994 mainDiv = mainDiv + endP
999 mainDiv = mainDiv + startP
1000 s = "SELECT people.Name,consort "\
1001 +"FROM consorts LEFT JOIN people"\
1002 +" ON people.ID = consorts.consort"\
1003 +" WHERE consorts.ID = ?"
1004 for row in run_query(s,t):
1005 mainDiv = mainDiv + print_tagged_name\
1006 ('Consort of',row,newLine)
1007 mainDiv = mainDiv + endP
1011 [parents,parentIDs,parentNames] = find_parents(personID)
1012 mainDiv = mainDiv + startP
1013 for i in range(len(parents)):
1014 r = [parentNames[i],parentIDs[i]]
1015 mainDiv = mainDiv + print_tagged_name('Parent',r,newLine)
1016 mainDiv = mainDiv + endP
1020 [spouses,spousesID,spousesNames] = find_spouses(personID)
1022 mainDiv = mainDiv + startP
1024 for i in range(len(spouses)):
1025 r = [spousesNames[i],spousesID[i]]
1026 mainDiv = mainDiv + print_tagged_name('Spouse',r,newLine)
1027 mainDiv = mainDiv + \
1028 relationship_html(personID,r[1],newLine)
1030 mainDiv = mainDiv + endP
1033 [nodes,IDs,names,childrenBorn] = \
1034 find_children(personID)
1037 for i in range(len(nodes)):
1038 cr = [names[i][0],IDs[i][0]]
1039 thisChild = print_tagged_name('Child',cr,newLine)
1041 opr=[names[i][1],IDs[i][1]]
1043 if i==0 or top != names[i-1][1]:
1044 mainDiv = mainDiv +endP
1045 mainDiv = mainDiv + startP
1046 mainDiv = mainDiv + print_tagged_name\
1047 ('With',opr, newLine)
1050 #age when child born
1051 cb = childrenBorn[i]
1052 if cb!=0 and bornYear != 0:
1054 thisChild = thisChild[:-4] + \
1055 " at the age of "+str(age) + newLine
1056 mainDiv = mainDiv + thisChild
1058 mainDiv = mainDiv + endP
1061 if newLine == '<br>':
1062 output = '<div id = "main" style = " float:left">';
1063 output = output + mainDiv + "</div>"
1065 output = output + "<div id = 'image' "\
1066 +"style = 'float:left; margin-left:20px'>"
1070 imageDiv = imageDiv + "<a href=" + url+">"\
1071 +"<img src=" + picture +" alt = 'wiki link'"\
1072 +" title = 'wiki link'></a>"\
1075 elif url!='.' and url!='. ':
1076 imageDiv = imageDiv + "<a href=" + url +">"\
1077 +name + " (wiki link)</a>"+newLine
1079 output = output + imageDiv + "</div>"
1082 url = 'http://www.chiark.greenend.org.uk/ucgi/~naath/'\
1086 form = form + "<form id ='controlForm'"\
1087 +" action ="+ url +" method = 'get'>"
1090 "<input type = 'hidden' name = 'ID' value = "\
1094 "Generations of Parents: "\
1095 +"<input type = 'text' name = 'pl' value='1'>"
1096 form = form + newLine
1098 "Generations of Children: "\
1099 +" <input type = 'text' name = 'cl' value = '1'>"
1100 form = form + newLine
1102 "Show siblings: <select name = 's'>"+\
1103 "<option value = '0'>No</option>"+\
1104 "<option value = '1'>Yes</option>"+\
1106 form = form + newLine
1108 "Show spouse's other spouses: <select name = 'os'>"+\
1109 "<option value = '0'>No</option>"+\
1110 "<option value = '1'>Yes</option>"+\
1112 form = form + newLine
1114 "Show parents' other spouses: <select name = 'pos'>"+\
1115 "<option value = '0'>No</option>"+\
1116 "<option value = '1'>Yes</option>"+\
1118 form = form + newLine
1121 "<input type = 'text' name = 'fs' value='8'>"
1122 form = form + newLine
1123 form = form + "</form>"
1125 graph = "smallGraph.py?ID="+str(personID)+"&fs=8"
1127 graph = "<img src ="+ graph + '>'
1129 output = output + "<div id = 'graph' style = 'clear:both'>"
1130 output = output + "<p id = 'agraph'>"+graph+"</p>"
1131 output = output + "Draw this graph with more relatives:"
1132 output = output + newLine + form
1134 output = output + "<button onclick='myFunction()'>"+\
1137 output = output + "</div>"
1141 'function myFunction()'+\
1143 'var x = document.getElementById("controlForm");'+\
1144 'var txt = "<img src = " + x.action + "?";'+\
1145 'for (var i=0;i<x.length;i++)'+\
1147 'var n=x.elements[i].name;'+\
1148 'var v=x.elements[i].value;'+\
1149 'txt = txt + "&"+n+"="+v;'+\
1151 'txt = txt + ">";'+\
1152 'document.getElementById("agraph").innerHTML=txt;'+\
1163 conn = sqlite3.connect\
1164 ('/home/naath/familyTreeProject/familyTree/tree.db')
1168 return conn.cursor()