]> wagnertech.de Git - SVBaL.git/blob - python/eh_util/eh_app/AWK/routines.py
pydev-s6
[SVBaL.git] / python / eh_util / eh_app / AWK / routines.py
1 import os
2 '''
3 def handle_uploaded_file(csv_file):
4     csv_file_name = str(csv_file)
5     data_path = config.getInstance().requireConfig("data_path")
6     path = os.path.join(data_path, csv_file_name)
7     with open(path, 'wb+') as destination:
8         for chunk in csv_file.chunks():
9             destination.write(chunk)
10 '''
11 def aktualisiere_config(config, data):
12     if data["briefpapier"]:
13         uploaded_file = data["briefpapier"]
14         data_path = config.requireConfig("data_path")
15         # copy briefpapier into data_path
16         with open(os.path.join(data_path, uploaded_file.name), 'wb+') as destination:
17             for chunk in uploaded_file.chunks():
18                 destination.write(chunk)
19         config.set_config("briefpapier", uploaded_file.name)
20     
21     if data["basisbeitrag"]:
22         config.set_config("beitrag_basis", data["basisbeitrag"])
23         
24     if data["zusatzbeitrag"]:
25         config.set_config("beitrag_zusatz", data["zusatzbeitrag"])
26