File indexing completed on 2024-12-22 04:16:24

0001 #
0002 #  SPDX-License-Identifier: GPL-3.0-or-later
0003 #
0004 
0005 import re
0006 from pathlib import Path
0007 
0008 
0009 def exportPath(cfg, path, dirname, userDefined):
0010     return dirname / (Path(path) if userDefined else (cfg["outDir"] / Path(path)))
0011 
0012 
0013 def sanitize(cfg, path):
0014     ps = map(lambda p: cfg["sym"].sub("_", p), Path(path).parts)
0015     return str(Path(*ps))