Ausgabe welche Config neu geschrieben wird hinzugefügt
This commit is contained in:
+10
-6
@@ -118,6 +118,7 @@ class Kosten():
|
|||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config["HW_Einzelpreise"] = latest_costs
|
config["HW_Einzelpreise"] = latest_costs
|
||||||
config["Preise durch Sivas nicht ermittelbar"] = not_found_in_sivas
|
config["Preise durch Sivas nicht ermittelbar"] = not_found_in_sivas
|
||||||
|
print("writing new config file", name)
|
||||||
with open(name, 'w') as configfile:
|
with open(name, 'w') as configfile:
|
||||||
config.write(configfile)
|
config.write(configfile)
|
||||||
|
|
||||||
@@ -133,6 +134,7 @@ class Kosten():
|
|||||||
new_prices.append(latest_costs.get(sivas_number))
|
new_prices.append(latest_costs.get(sivas_number))
|
||||||
data = {"Sivas-Nummern":sivas_numbers, "Alte Preise":old_prices, "Neue Preise":new_prices}
|
data = {"Sivas-Nummern":sivas_numbers, "Alte Preise":old_prices, "Neue Preise":new_prices}
|
||||||
df = pd.DataFrame.from_dict(data)
|
df = pd.DataFrame.from_dict(data)
|
||||||
|
print("write price increments", name)
|
||||||
df.to_excel(name, sheet_name="Preisänderungen", index_label="Sivas-Nummern")
|
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")
|
parser.add_argument('-o', '--outfile', action='store', help='name of the output excel file', default="Preis_Increments.xlsx")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
zuordCfgFilePath = os.path.join(os.environ.get('ECALC_CFG'), "Zuordnung_Teilenummern.cfg")
|
base = os.environ.get('ECALC_CFG')
|
||||||
sivasCfgFilePath = os.path.join(os.environ.get('ECALC_CFG'), "Sivas_Daten.cfg")
|
zuordCfgFilePath = os.path.join(base, "Zuordnung_Teilenummern.cfg")
|
||||||
gridExportFilePath = os.path.join(os.environ.get('ECALC_CFG'), "grid_export.xlsx")
|
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")
|
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")
|
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")
|
print("no grid_export.xlsx with prices from SIVAS in ECALC_CFG")
|
||||||
|
|
||||||
# lies die alten config und die Excel-Liste mit den Sivas-Daten
|
# lies die alten config und die Excel-Liste mit den Sivas-Daten
|
||||||
|
|||||||
Reference in New Issue
Block a user