Ausgabe welche Config neu geschrieben wird hinzugefügt

This commit is contained in:
2023-07-18 13:03:06 +02:00
parent 844aedc02b
commit 6350ddf850
+10 -6
View File
@@ -118,6 +118,7 @@ class Kosten():
config = configparser.ConfigParser()
config["HW_Einzelpreise"] = latest_costs
config["Preise durch Sivas nicht ermittelbar"] = not_found_in_sivas
print("writing new config file", name)
with open(name, 'w') as configfile:
config.write(configfile)
@@ -133,6 +134,7 @@ class Kosten():
new_prices.append(latest_costs.get(sivas_number))
data = {"Sivas-Nummern":sivas_numbers, "Alte Preise":old_prices, "Neue Preise":new_prices}
df = pd.DataFrame.from_dict(data)
print("write price increments", name)
df.to_excel(name, sheet_name="Preisänderungen", index_label="Sivas-Nummern")
@@ -143,15 +145,17 @@ if __name__ == '__main__':
parser.add_argument('-o', '--outfile', action='store', help='name of the output excel file', default="Preis_Increments.xlsx")
args = parser.parse_args()
zuordCfgFilePath = os.path.join(os.environ.get('ECALC_CFG'), "Zuordnung_Teilenummern.cfg")
sivasCfgFilePath = os.path.join(os.environ.get('ECALC_CFG'), "Sivas_Daten.cfg")
gridExportFilePath = os.path.join(os.environ.get('ECALC_CFG'), "grid_export.xlsx")
base = os.environ.get('ECALC_CFG')
zuordCfgFilePath = os.path.join(base, "Zuordnung_Teilenummern.cfg")
sivasCfgFilePath = os.path.join(base, "Sivas_Daten.cfg")
gridExportFilePath = os.path.join(base, "grid_export.xlsx")
if not os.path.isfile(zuordCfgFilePath):
if not os.path.exists(zuordCfgFilePath):
print("no Zuordnung_Teilenummern.cfg in ECALC_CFG")
if not os.path.isfile(sivasCfgFilePath):
if not os.path.exists(sivasCfgFilePath):
print("no Sivas_Daten.cfg in ECALC_CFG")
if not os.path.isfile(gridExportFilePath):
if not os.path.exists(gridExportFilePath):
print("no grid_export.xlsx with prices from SIVAS in ECALC_CFG")
# lies die alten config und die Excel-Liste mit den Sivas-Daten