14 def make_insert(table,fields):
15 s = 'INSERT INTO ' + table + ' VALUES('
30 if thisline[-2:] == '\r\n':
31 thisline = thisline[:-2]
34 if lastline == 'Name:':
35 names = thisline.split()
37 notNames = ['Prince','Princess','St']
38 if names[0] in notNames:
39 firstName = add_quotes(names[1])
41 firstName = add_quotes(names[0])
44 thisName = add_quotes(thisline)
45 if lastline == 'Born:':
46 yb = findYear.find_year(thisline)
47 mb = findYear.find_month(thisline)
48 thisBorn = add_quotes(thisline)
49 if lastline == 'Died:':
50 yd = findYear.find_year(thisline)
51 md = findYear.find_month(thisline)
52 thisDied = add_quotes(thisline)
54 if lastline == 'URL:':
55 url = add_quotes(thisline)
56 if lastline == 'Picture:':
57 picture = add_quotes(thisline)
58 if lastline == 'Father:':
59 a = is_number(thisline)
60 s = make_insert('parents',[thisID, a])
62 if lastline=='Mother:':
64 s = make_insert('parents',[thisID, a])
67 if finishedRecord ==1:
68 s = make_insert('people',\
69 [thisID,thisName,firstName,thisBorn,yb,\
70 thisDied,yd,mb,md,url,picture])
73 if lastline == 'Style:':
74 thisStyle = add_quotes(thisline)
80 thisTerr.append(add_quotes(thisline))
81 if lastline == 'Territories:':
82 thisTerr=[add_quotes(thisline)]
86 yf = findYear.find_year(thisline)
87 thisFrom = add_quotes(thisline)
89 yt = findYear.find_year(thisline)
90 thisTo = add_quotes(thisline)
91 s = make_insert('styles',[thisID,thisStyle,thisFrom,\
96 s = make_insert('territories',[thisID,terr,\
97 thisFrom,yf,thisTo,yt])