@@ -196,7 +196,8 @@ def process_substitutions(bom_name_format, pcb_file_name, metadata):
196
196
name = name .replace ('%D' , now .strftime ('%Y-%m-%d' ))
197
197
name = name .replace ('%T' , now .strftime ('%H-%M-%S' ))
198
198
# sanitize the name to avoid characters illegal in file systems
199
- name = re .sub (r'[/\\?%*:|"<>]' , '_' , name )
199
+ name = name .replace ('\\ ' , '/' )
200
+ name = re .sub (r'[?%*:|"<>]' , '_' , name )
200
201
return name + '.html'
201
202
202
203
@@ -212,11 +213,12 @@ def get_file_content(file_name):
212
213
bom_file_dir = config .bom_dest_dir
213
214
else :
214
215
bom_file_dir = os .path .join (pcb_file_dir , config .bom_dest_dir )
215
- if not os .path .isdir (bom_file_dir ):
216
- os .makedirs (bom_file_dir )
217
216
bom_file_name = process_substitutions (
218
217
config .bom_name_format , pcb_file_name , pcbdata ['metadata' ])
219
218
bom_file_name = os .path .join (bom_file_dir , bom_file_name )
219
+ bom_file_dir = os .path .dirname (bom_file_name )
220
+ if not os .path .isdir (bom_file_dir ):
221
+ os .makedirs (bom_file_dir )
220
222
pcbdata_js = "var pcbdata = " + json .dumps (pcbdata )
221
223
config_js = "var config = " + config .get_html_config ()
222
224
html = get_file_content ("ibom.html" )
0 commit comments