import sqlite3
import findYear
+from string import Template
+
+global link_Template
+link_Template= Template("<a href = http://www.chiark.greenend.org.uk/ucgi/~naath/$script>$text</a>")
def run_query(s,t):
c = make_cursor()
mine = mine + print_tagged_name(relationship,row,newLine)
return mine
-def base_url():
- return "http://www.chiark.greenend.org.uk/ucgi/~naath/"
def relationship_html(ID,ID2,newLine):
if newLine=='<br>':
relationship = common_ancestors(ID,ID2,newLine)[2]
- url=base_url()+"ancestors.py?ID="+ID+"&ID2="\
- +str(ID2)
- return relationship + ':<a href='+url+'> Common Ancestors</a>'+newLine
+ script = "ancestors.py?ID="+ID+"&ID2="+str(ID2)
+ return link_Template.substitute(script = script,text = "Common ancestors")
else:
return ''
def terr_html(terr,newLine):
if newLine=='<br>':
- url = base_url()+"territory.py?terr="
- return '<a href ='+url + terr+'>'+terr+'</a>'
-
+ return link_Template.substitute(script = "territory.py?terr="+terr, text=terr)
else:
return terr
def name_html(row,html):
elif html=='\n':
html=0
if html == 1:
- url = base_url()+"person.py?ID=" + str(row[1])
+ script = "person.py?ID=" + str(row[1])
name = row[0]
- return "<a href = "+url+">"+str(name)+"</a>"
+ return link_Template.substitute(script = script, text = name)
if row[0] == None:
return row[1]
else: