rework icons, codechanges, bugfixes, typofixes

This commit is contained in:
WorldTeacher
2024-10-09 08:47:48 +02:00
parent cd74214c17
commit 2746b917eb
58 changed files with 142 additions and 89 deletions

View File

@@ -46,7 +46,7 @@ def tuple_to_dict(tlist: tuple, type: str) -> dict:
ret = []
for line in tlist:
data = makeDict()
if type == "Monographie":
if type == "Monografien":
data["type"] = type
data["work_author"] = line[0]
data["year"] = line[1]
@@ -84,10 +84,10 @@ def tuple_to_dict(tlist: tuple, type: str) -> dict:
def elsa_word_to_csv(path):
doc = Document(path)
# print all lines in doc
# # print all lines in doc
doctype = [para.text for para in doc.paragraphs if para.text != ""][-1]
tuples = {
"Monographie": ("", "", "", "", "", "", "", "", ""),
"Monografien": ("", "", "", "", "", "", "", "", ""),
"Herausgeberwerke": ("", "", "", "", "", "", "", "", "", "", ""),
"Zeitschriftenaufsätze": ("", "", "", "", "", "", "", "", "", ""),
}
@@ -113,10 +113,10 @@ def elsa_word_to_csv(path):
data = [
row for row in df.itertuples(index=False, name=None) if row != tuples[doctype]
]
print(data)
# print(data)
return tuple_to_dict(data, doctype), doctype
if __name__ == "__main__":
else_df = elsa_word_to_csv("c:/Users/aky547/Desktop/hrsgw_test.docx")
print(else_df)
else_df = elsa_word_to_csv("C:/Users/aky547/Desktop/Antrag ELSA Schweitzer.docx")
# print(else_df)