import.py: use pathlib and support Windows

This commit is contained in:
linsui 2021-06-08 18:33:22 +08:00
parent 7ddcbb3e80
commit d6eece6395
6 changed files with 175 additions and 153 deletions

View file

@ -978,6 +978,8 @@ build_cont = re.compile(r'^[ \t]')
def write_metadata(metadatapath, app):
# TODO: Remove this
metadatapath = str(metadatapath)
if metadatapath.endswith('.yml'):
if importlib.util.find_spec('ruamel.yaml'):
with open(metadatapath, 'w') as mf: