mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 15:30:28 +03:00
do not delete yml metadata when raumel not installed
This commit is contained in:
parent
0885303672
commit
8e5232076f
2 changed files with 14 additions and 9 deletions
|
|
@ -27,6 +27,7 @@ import logging
|
|||
import textwrap
|
||||
import io
|
||||
import yaml
|
||||
import importlib
|
||||
from collections import OrderedDict
|
||||
|
||||
import fdroidserver.common
|
||||
|
|
@ -1584,11 +1585,15 @@ def write_metadata(metadatapath, app):
|
|||
warn_or_exception(_('Cannot write "{path}", not an accepted format, use: {formats}')
|
||||
.format(path=metadatapath, formats=', '.join(accepted)))
|
||||
|
||||
with open(metadatapath, 'w') as mf:
|
||||
if ext == 'txt':
|
||||
if ext == 'txt':
|
||||
with open(metadatapath, 'w') as mf:
|
||||
return write_txt(mf, app)
|
||||
elif ext == 'yml':
|
||||
return write_yaml(mf, app)
|
||||
elif ext == 'yml':
|
||||
if importlib.util.find_spec('ruamel.yaml'):
|
||||
with open(metadatapath, 'w') as mf:
|
||||
return write_yaml(mf, app)
|
||||
else:
|
||||
raise FDroidException('ruamel.yaml not installed, can not write metadata.')
|
||||
|
||||
warn_or_exception(_('Unknown metadata format: %s') % metadatapath)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue