mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
metadata: use yaml C implementation when available
This is an order of magnitude faster. Requires the C yaml bindings to be installed. Fixes fdroid/fdroidserver#716
This commit is contained in:
parent
44694a0bc7
commit
01d00d54ca
1 changed files with 5 additions and 1 deletions
|
|
@ -27,6 +27,10 @@ import logging
|
||||||
import textwrap
|
import textwrap
|
||||||
import io
|
import io
|
||||||
import yaml
|
import yaml
|
||||||
|
try:
|
||||||
|
from yaml import CSafeLoader as SafeLoader
|
||||||
|
except ImportError:
|
||||||
|
from yaml import SafeLoader
|
||||||
import importlib
|
import importlib
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
|
@ -1070,7 +1074,7 @@ def parse_json_metadata(mf, app):
|
||||||
|
|
||||||
|
|
||||||
def parse_yaml_metadata(mf, app):
|
def parse_yaml_metadata(mf, app):
|
||||||
yamldata = yaml.safe_load(mf)
|
yamldata = yaml.load(mf, Loader=SafeLoader)
|
||||||
|
|
||||||
deprecated_in_yaml = ['Provides']
|
deprecated_in_yaml = ['Provides']
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue