|
2 | 2 |
|
3 | 3 | import argparse |
4 | 4 | import os |
| 5 | +import re |
5 | 6 |
|
6 | 7 | from wx import FileConfig |
7 | 8 |
|
|
10 | 11 |
|
11 | 12 | class Config: |
12 | 13 | FILE_NAME_FORMAT_HINT = ( |
13 | | - 'Output file name format supports substitutions:\n' |
14 | | - '\n' |
15 | | - ' %f : original pcb file name without extension.\n' |
16 | | - ' %p : pcb/project title from pcb metadata.\n' |
17 | | - ' %c : company from pcb metadata.\n' |
18 | | - ' %r : revision from pcb metadata.\n' |
19 | | - ' %d : pcb date from metadata if available, ' |
20 | | - 'file modification date otherwise.\n' |
21 | | - ' %D : bom generation date.\n' |
22 | | - ' %T : bom generation time.\n' |
23 | | - '\n' |
24 | | - 'Extension .html will be added automatically.' |
| 14 | + 'Output file name format supports substitutions:\n' |
| 15 | + '\n' |
| 16 | + ' %f : original pcb file name without extension.\n' |
| 17 | + ' %p : pcb/project title from pcb metadata.\n' |
| 18 | + ' %c : company from pcb metadata.\n' |
| 19 | + ' %r : revision from pcb metadata.\n' |
| 20 | + ' %d : pcb date from metadata if available, ' |
| 21 | + 'file modification date otherwise.\n' |
| 22 | + ' %D : bom generation date.\n' |
| 23 | + ' %T : bom generation time.\n' |
| 24 | + '\n' |
| 25 | + 'Extension .html will be added automatically.' |
25 | 26 | ) # type: str |
26 | 27 |
|
27 | 28 | # Helper constants |
@@ -76,7 +77,7 @@ class Config: |
76 | 77 | @staticmethod |
77 | 78 | def _split(s): |
78 | 79 | """Splits string by ',' and drops empty strings from resulting array.""" |
79 | | - return [a for a in s.split(',') if a] |
| 80 | + return [a.replace('\\,', ',') for a in re.split(r'(?<!\\),', s) if a] |
80 | 81 |
|
81 | 82 | def __init__(self): |
82 | 83 | """Init from config file if it exists.""" |
|
0 commit comments