-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgenerate_config_bundle.py
30 lines (25 loc) · 992 Bytes
/
generate_config_bundle.py
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
import os, datetime
fp = open("PrusaSlicer_config_bundle.ini", "w")
fp.write("# generated by https://github.com/suchmememanyskill/PrusaSlicer-Ender3-v3-SE-Config on " + datetime.datetime.utcnow().strftime("%Y-%m-%d at %H:%M:%S UTC") + "\n\n")
for x in ['print', 'filament', 'printer']:
dirPath = os.path.join("PrusaSlicer", x)
if os.path.isdir(dirPath):
for y in os.listdir(dirPath):
filePath = os.path.join(dirPath, y)
if os.path.isfile(filePath):
fp.write(f"[{x}:{y.replace('.ini', '')}]\n")
with open(filePath, "r") as f:
for z in f.readlines():
if z.startswith("#"):
continue
fp.write(z)
fp.write("\n\n")
presets = """[presets]
print = Normal 0.20mm @ Ender 3 V3 SE
sla_print =
sla_material =
printer = Ender 3 V3 SE
filament = PLA 210C 60C
"""
fp.write(presets)
fp.close()