From 4e7f3cbf7740e893230bb2ae684b9761e99a95d3 Mon Sep 17 00:00:00 2001 From: manetta Date: Tue, 9 Nov 2021 23:15:49 +0100 Subject: [PATCH] backup of update.py --- command-line/update.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/command-line/update.py b/command-line/update.py index 15db5fc..f0264f1 100644 --- a/command-line/update.py +++ b/command-line/update.py @@ -167,6 +167,41 @@ def tweaking(html): html = html.replace('trans*genealogical', 'trans✶genealogical') html = html.replace('✶', '') html = html.replace('

.* +

.*? +

''' # title + author + pattern2 = r'''

.*?

+

.*?

+

.*? +

''' # exceptions: custom running headers + pattern3 = r'''

.*?

''' # only title + pattern4 = r'''

x, y, z \(4 filmstills\)

+

Jara Rocha, Femke Snelting +

''' + pattern5 = r'''

Somatopologies \(materials
for a movie in the making\)

+

Possible Bodies \(Jara Rocha, Femke Snelting\) +

''' + pattern6 = r'''

Rehearsal as the \‘Other\’ to Hypercomputation

+

Maria Dada +

''' + pattern7 = r'''

We hardly encounter anything that didn’t really matter

+

Phil Langley in conversation with Possible Bodies +

''' + + results = re.findall(rf'{pattern1}|{pattern2}|{pattern3}|{pattern4}|{pattern5}|{pattern6}|{pattern7}', html) + for match in results: + html = html.replace(match, f'
{ match }
') + + # for result in results: + # print(result) + # print('---') + # print('---') + # print('AANTAL:', len(results)) + # print('SET LEN:', len(set(results))) + # print('---') + + # html = html.replace('', '') # html = html.replace('', '') return html