1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 06:44:21 +00:00

🎓 Fix the script

This commit is contained in:
Steffo 2021-12-02 17:55:39 +01:00
parent e5e897b192
commit 4d45228028
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -1,10 +1,19 @@
import re import re
with open("build/latex/progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex", "r") as file: with open("build/latex/progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex", "r") as file:
print("Reading file...")
text = file.read() text = file.read()
text = re.sub(r"\\renewcommand[{]\\indexname[}][{]Indice del modulo Python[}].*?\\end[{]sphinxtheindex[}]", "", text, re.DOTALL) print("Performing first sub...", end=" ")
text = re.sub(r"\\renewcommand[{]\\indexname[}][{]HTTP Routing Table[}].*?\\end[{]sphinxtheindex[}]", "", text, re.DOTALL) text, number = re.subn(r"\\renewcommand[{]\\indexname[}][{]Indice del modulo Python[}].*?\\end[{]sphinxtheindex[}]", "", text, flags=re.DOTALL)
print(number)
print("Performing second sub...", end=" ")
text, number = re.subn(r"\\renewcommand[{]\\indexname[}][{]HTTP Routing Table[}].*?\\end[{]sphinxtheindex[}]", "", text, flags=re.DOTALL)
print(number)
with open("build/latex/progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex", "w") as file: with open("build/latex/progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex", "w") as file:
print("Writing file...")
file.write(text) file.write(text)
print("Done!")