|
|
|
@ -53,11 +53,15 @@ def prince_corpus(house=None, prince=None):
|
|
|
|
Acte.id_acte == acte)]
|
|
|
|
Acte.id_acte == acte)]
|
|
|
|
prince_acte.append(info[0])
|
|
|
|
prince_acte.append(info[0])
|
|
|
|
prince_acte = sorted(prince_acte)
|
|
|
|
prince_acte = sorted(prince_acte)
|
|
|
|
return render_template("prince_corpus.html", houseS=house, duke_name=prince_name, lst_id=prince_acte)
|
|
|
|
print(prince_acte)
|
|
|
|
|
|
|
|
|
|
|
|
@main.route("/actes/<house>/<prince>/<acte_id>") # don't put a slash at the end
|
|
|
|
return render_template("prince_corpus.html", houseS=house, duke_name=prince_name,
|
|
|
|
|
|
|
|
lst_id=prince_acte)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@main.route("/acte/<prince>/<acte_id>") # don't put a slash at the end
|
|
|
|
def acte(house=None, prince=None, acte_id=None):
|
|
|
|
def acte(house=None, prince=None, acte_id=None):
|
|
|
|
"""acte route"""
|
|
|
|
"""acte route"""
|
|
|
|
|
|
|
|
print(prince)
|
|
|
|
q_prod = Involved_in.select().where(
|
|
|
|
q_prod = Involved_in.select().where(
|
|
|
|
(Involved_in.involved_in_prince == prince)
|
|
|
|
(Involved_in.involved_in_prince == prince)
|
|
|
|
&(Involved_in.invol_in_interv == 1))
|
|
|
|
&(Involved_in.invol_in_interv == 1))
|
|
|
|
@ -79,6 +83,19 @@ def acte(house=None, prince=None, acte_id=None):
|
|
|
|
state = [t.state_label for t in State.select().where(
|
|
|
|
state = [t.state_label for t in State.select().where(
|
|
|
|
State.id_state == acte_state_id)]
|
|
|
|
State.id_state == acte_state_id)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if the acte if in another house's folder,
|
|
|
|
|
|
|
|
# change <house> according to the begining of filename
|
|
|
|
|
|
|
|
# (i. e. the house abreviation)
|
|
|
|
|
|
|
|
print(acte_id)
|
|
|
|
|
|
|
|
dict_house = {'brb': 'Bourbon', 'bry': 'Berry', 'anj': 'Anjou'}
|
|
|
|
|
|
|
|
pattern_house = re.compile(r'([a-z]{3})_[a-z]+_[ivx]+_\d+(_\d+_\d+)?[a-z]')
|
|
|
|
|
|
|
|
name_house = re.search(pattern_house, acte_id)
|
|
|
|
|
|
|
|
house = dict_house[name_house.group(1)]
|
|
|
|
|
|
|
|
print(house)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
source_doc = etree.parse(
|
|
|
|
source_doc = etree.parse(
|
|
|
|
os.path.join(APPPATH, "static", "xml", house, acte_id + '.xml'))
|
|
|
|
os.path.join(APPPATH, "static", "xml", house, acte_id + '.xml'))
|
|
|
|
# remove namespace :
|
|
|
|
# remove namespace :
|
|
|
|
@ -91,7 +108,6 @@ def acte(house=None, prince=None, acte_id=None):
|
|
|
|
xslt_doc = etree.parse(os.path.join(APPPATH, "static", "xsl", "actes_princiers.xsl"))
|
|
|
|
xslt_doc = etree.parse(os.path.join(APPPATH, "static", "xsl", "actes_princiers.xsl"))
|
|
|
|
xslt_transformer = etree.XSLT(xslt_doc)
|
|
|
|
xslt_transformer = etree.XSLT(xslt_doc)
|
|
|
|
output_doc = xslt_transformer(source_doc)
|
|
|
|
output_doc = xslt_transformer(source_doc)
|
|
|
|
print(output_doc)
|
|
|
|
|
|
|
|
return render_template("acte.html", house=house, prince=prince,
|
|
|
|
return render_template("acte.html", house=house, prince=prince,
|
|
|
|
infos=q_acte, place=place[0], doc=doc[0][0], arch=inst[0],
|
|
|
|
infos=q_acte, place=place[0], doc=doc[0][0], arch=inst[0],
|
|
|
|
diplo=diplo_t[0].replace("_", " "), state=state[0],
|
|
|
|
diplo=diplo_t[0].replace("_", " "), state=state[0],
|
|
|
|
|