-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_exports.py
More file actions
37 lines (33 loc) · 1.56 KB
/
Copy pathupdate_exports.py
File metadata and controls
37 lines (33 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 1. export.py
with open("app/domains/import_export/routers/export.py", "r") as f:
content = f.read()
content = content.replace(
'"ipv6_adresse": d.ipv6_adresse or "–",', '"ipv6": d.ipv6_adresse or "–",'
)
with open("app/domains/import_export/routers/export.py", "w") as f:
f.write(content)
# 2. full_csv.py
with open("app/domains/import_export/services/exports/full_csv.py", "r") as f:
content = f.read()
content = content.replace('d.get("ipv6_adresse", ""),', 'd.get("ipv6", ""),', 1)
with open("app/domains/import_export/services/exports/full_csv.py", "w") as f:
f.write(content)
# 3. full_ods.py
with open("app/domains/import_export/services/exports/full_ods.py", "r") as f:
content = f.read()
content = content.replace('d.get("ipv6_adresse", "–"),', 'd.get("ipv6", "–"),', 1)
with open("app/domains/import_export/services/exports/full_ods.py", "w") as f:
f.write(content)
# 4. full_xlsx.py
with open("app/domains/import_export/services/exports/full_xlsx.py", "r") as f:
content = f.read()
content = content.replace('d.get("ipv6_adresse", "–"),', 'd.get("ipv6", "–"),', 1)
with open("app/domains/import_export/services/exports/full_xlsx.py", "w") as f:
f.write(content)
# 5. racks.py
with open("app/domains/import_export/services/exports/racks.py", "r") as f:
content = f.read()
content = content.replace('d.get("ipv6_adresse", "–"),', 'd.get("ipv6", "–"),')
content = content.replace('d.get("ipv6_adresse", ""),', 'd.get("ipv6", ""),')
with open("app/domains/import_export/services/exports/racks.py", "w") as f:
f.write(content)