From 3e2dcb8dab9500ead92081262c42fb7cdbf86bd0 Mon Sep 17 00:00:00 2001 From: Georg Sauthoff Date: Sun, 13 Jun 2021 18:57:38 +0200 Subject: [PATCH] integrate namechanges that are slated for 2021-07-01 cf. ppl_v490_partner.csv --- examples/update_products.py | 15 +++++++++------ inema/data/products.json | 16 ++++++++-------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/examples/update_products.py b/examples/update_products.py index 0eeabdc..261c86a 100755 --- a/examples/update_products.py +++ b/examples/update_products.py @@ -49,12 +49,15 @@ def main(csv_filename, json_filename, filename): p['international'] = inter if weight != oweight: print(f'Weight of {name} ({key}) changed: {oweight} -> {weight} (from {row["PROD_GUEAB"]})') - c = True - p['max_weight'] = weight - # The names returned by the ProdWS differ from the ones included in the PPL ... - # if name != oname: - # print(f'Name of {name} ({key}) changed: {oname} -> {name} (from {row["PROD_GUEAB"]})') - # c = True + # as approximation, use old one ... + if weight: + c = True + p['max_weight'] = weight + # The names returned by the ProdWS might differ from the ones included in the PPL ... + if name != oname: + print(f'Name of {name} ({key}) changed:\n{oname} ->\n{name} (from {row["PROD_GUEAB"]})') + c = True + p['name'] = name if c: print('*'*75) else: diff --git a/inema/data/products.json b/inema/data/products.json index 2d9d93f..54a70b1 100644 --- a/inema/data/products.json +++ b/inema/data/products.json @@ -87,7 +87,7 @@ "cost_price": "0.95", "international": true, "max_weight": "15", - "name": "Postkarte Intern." + "name": "Postkarte Intern. GK" }, "1022": { "cost_price": "3.75", @@ -309,37 +309,37 @@ "cost_price": "7.1", "international": false, "max_weight": "2000", - "name": "Maxibrief Integral + EINSCHREIBEN EINWURF + Zusatzentgelt MBf" + "name": "Maxibrief Integral + Zusatzentgelt MBf + EINSCHREIBEN EINWURF" }, "1047": { "cost_price": "7.4", "international": false, "max_weight": "2000", - "name": "Maxibrief Integral + EINSCHREIBEN + Zusatzentgelt MBf" + "name": "Maxibrief Integral + Zusatzentgelt MBf + EINSCHREIBEN" }, "1049": { "cost_price": "9.6", "international": false, "max_weight": "2000", - "name": "Maxibrief Integral + EINSCHREIBEN + EIGENHÄNDIG + Zusatzentgelt MBf" + "name": "Maxibrief Integral + Zusatzentgelt MBf + EINSCHREIBEN + EIGENHÄNDIG" }, "1052": { "cost_price": "2.8", "international": false, "max_weight": "15", - "name": "Postkarte Einschreiben Einwurf" + "name": "Postkarte Integral + EINSCHREIBEN EINWURF" }, "1057": { "cost_price": "3.1", "international": false, "max_weight": "15", - "name": "Postkarte Einschreiben" + "name": "Postkarte Integral + EINSCHREIBEN" }, "1059": { "cost_price": "5.3", "international": false, "max_weight": "15", - "name": "Postkarte Einsch+Eigh" + "name": "Postkarte Integral + EINSCHREIBEN + EIGENHÄNDIG" }, "11": { "cost_price": "0.95", @@ -381,7 +381,7 @@ "cost_price": "4.45", "international": true, "max_weight": "15", - "name": "Postkarte Intern. Einschreiben" + "name": "Postkarte Intern. GK Integral + EINSCHREIBEN" }, "195": { "cost_price": "1.8",