From 0795636bd204502f6174ed0e86883944e7c22c73 Mon Sep 17 00:00:00 2001 From: zeroth Date: Tue, 16 Apr 2019 15:58:52 +0100 Subject: [PATCH] regex link fine --- __pycache__/contextualise.cpython-35.pyc | Bin 2787 -> 3079 bytes contextualise.py | 41 +++++++---------------- templates/description.html | 6 ++-- 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/__pycache__/contextualise.cpython-35.pyc b/__pycache__/contextualise.cpython-35.pyc index c54d451b3b5e6e8f11f78a270ff73e711bee55d6..a7ade1b99e43f1989887f57ef049b9b5bd8e1d1f 100644 GIT binary patch delta 1260 zcmb7DO>7fK6#iz{Kbwu6KgV9%aZH?q*iIk`5TFO3NJXvGLj*yJ(UwXznSpqr1dpAP zSdOeJMchEqs+S&n>zQ(EkDPkq>H|G+>4gK8dPTgqu_gX4-PL~k-h4CPyf^R7%jCoK zj1!OBbFZFWKQjcp#5<2o_C@*{y9YBrk4iv>aAyqe7?glY9Q^6bjzf*ZOTtS*#<4FT z*tg+1P=kRlhYsFkJ2~6}+)RL3)^R7HMj(fwhOrOq8*uZGBXExdbEX0;VCNZB9Nsik zn$<3S`#Y|iaMN&S;Lc*_SEyMU{RQq(sH5=aAV+y(Og|Mpe~kRj;Q%S6;T2hoNZzvq zm4jFA$qO|RI3>sg2l>E2Cdla>WxXyqqK|blpIlmB7nSGp!!l%!2{{Rw$4^vUQaIVC zjs(;cWT8);>QmDJH3K=@r&jtDm5T(ayv06snpzODgxd!6w#jXGW)!jvIZq8Ggbd+o zdErUR{6~l{{f+SV;_D~R!!aRN{TGpAMT`16LEjhL-~SRcsl5f7vODhImCO?^=O-XD|oFiua-ww{lB9t^R9Wny4%W}t4?id zb@P02N!ET)`j+~3yKdOHEUaUD>Tqx3T9Re3tQMm+(?R? zh>3_uiDV>i=(EJOtbSPjU!jr}>&58*7A_>CJ?9>48LVaK&-@owN}ToovucJu>3=iu zd|`zMy~uEypc~d(+fAi&JTS>H$H05h;x&6Aag)pyF+y*Q-W31+NA_AcGZBi3w<9R_ A^8f$< delta 1038 zcmb7D&rcIU6#izHW!vo*N=xYvS|}6>6|4w_t0ZcSB$5b*k`3BOW`e9i(-jg(N_s$} z(HLVUT)gScn+f^{c<{i*KY)W5F8&D~IQV9v2GEN;*)Q|n_vZbWdGC4hFrH6@!`A+f zFH5gGfJ2=6EZR@g|77lMezzeQL=@Zv4}b^3E$|SyjUA>tF^Cx4PPlRKFloS)Y{Bh< z2>CK^gOk7t;3R!a`Iz>x`;4Bqz{x;Fz}q3(u>5VJUCm(0z^YqGJC!f zFRJ}dJdrv{L*-qIYL(g%tB4{*(tjk{@lJoYN)L4bVgx*{NZy4;D#7WNHN45e8HKRn zUW6D`)=mkc1fE37$)Q3wb9-)4In5nArB1j6o>Br&gLmU8Jt>_U^P7gKj8A33dz#ec zCe`axIq<$4O>Vr&_4`~Ne4t59_#HZkhZ?+DUA15tyZ}B#UBnn~!F+Le@4fz$vFq}s zvBqxh{W5IEZb`!&ZEK}YrwPDS)$w2D6*I|R$whNGa1V8j?tVeOFvnuO*aqr=+p0Qq z+rYXhkIZbgITK_`V^P=DWYi7HP@gY`gTFq`#+y)x+!0@do;{nba+>Vd(<^2W-Y;-m~&t8&ZwUKl3> sucTl?nHt{XjdkH=lp?F3pr9
') - - # #if sound - # elif file.lower().endswith(('.mp3')): - # file = Markup('''''') - #if txtfile - # if file.lower().endswith(('.txt')): - # # print(thefile) - # with open("static/"+file,"r") as f: - # textfile = f.readlines() - if file.lower().endswith(('.html')): - # print(thefile) with open("static/"+file,"r", encoding='utf-8') as f: textfile = f.read() - textfile = Markup(textfile) - + word = "way" + wordlinked = ""+word+"" + textfile = re.sub(word, wordlinked, textfile) - # #ifvid to be added - # elif file.lower().endswith(('.mp4')): - # file = Markup(''' ''') +# go into the textfile content, find the words, +# replace word with word + + textfile = Markup(textfile) - return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfile=textfile) +@app.route('/diverge') +def diverge(): + return render_template('diverge.html') if __name__ == '__main__': - app.run(debug=True) \ No newline at end of file + app.run(debug=True) diff --git a/templates/description.html b/templates/description.html index fabf6ba..afcca10 100644 --- a/templates/description.html +++ b/templates/description.html @@ -15,13 +15,13 @@
- + {% elif item.lower().endswith(('.mp4')) %}
- + {% elif item.lower().endswith(('.mp3')) %}