Skip to content

Commit 5fb24b3

Browse files
authored
[script.module.yaml] 6.0.1 (#2522)
1 parent c3a9f51 commit 5fb24b3

File tree

11 files changed

+60
-296
lines changed

11 files changed

+60
-296
lines changed

script.module.yaml/CHANGES

Lines changed: 0 additions & 179 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2017-2019 Ingy döt Net
1+
Copyright (c) 2017-2021 Ingy döt Net
22
Copyright (c) 2006-2016 Kirill Simonov
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy of

script.module.yaml/README

Lines changed: 0 additions & 43 deletions
This file was deleted.

script.module.yaml/addon.xml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="script.module.yaml"
3-
name="PyYAML"
4-
version="5.3.0+matrix.2"
5-
provider-name="Kirill Simonov">
2+
<addon id="script.module.yaml" name="PyYAML" version="6.0.1" provider-name="Kirill Simonov">
63
<requires>
7-
<import addon="xbmc.python" version="3.0.0"/>
4+
<import addon="xbmc.python" version="3.0.0" />
85
</requires>
9-
<extension point="xbmc.python.module"
10-
library="lib" />
6+
<extension point="xbmc.python.module" library="lib" />
117
<extension point="xbmc.addon.metadata">
12-
<platform>all</platform>
138
<summary lang="en_GB">YAML parser and emitter for Python</summary>
14-
<description lang="en_GB">A packaged version of files needed for the pyyamml library.</description>
9+
<description lang="en_GB">YAML parser and emitter for Python</description>
1510
<license>MIT</license>
11+
<platform>all</platform>
1612
<website>https://pyyaml.org</website>
1713
<source>https://github.com/yaml/pyyaml</source>
1814
<assets>
19-
<icon>icon.png</icon>
15+
<icon>resources/icon.png</icon>
2016
</assets>
2117
</extension>
2218
</addon>

script.module.yaml/lib/yaml/__init__.py

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .loader import *
99
from .dumper import *
1010

11-
__version__ = '5.3'
11+
__version__ = '6.0.1'
1212
try:
1313
from .cyaml import *
1414
__with_libyaml__ = True
@@ -18,41 +18,12 @@
1818
import io
1919

2020
#------------------------------------------------------------------------------
21-
# Warnings control
21+
# XXX "Warnings control" is now deprecated. Leaving in the API function to not
22+
# break code that uses it.
2223
#------------------------------------------------------------------------------
23-
24-
# 'Global' warnings state:
25-
_warnings_enabled = {
26-
'YAMLLoadWarning': True,
27-
}
28-
29-
# Get or set global warnings' state
3024
def warnings(settings=None):
3125
if settings is None:
32-
return _warnings_enabled
33-
34-
if type(settings) is dict:
35-
for key in settings:
36-
if key in _warnings_enabled:
37-
_warnings_enabled[key] = settings[key]
38-
39-
# Warn when load() is called without Loader=...
40-
class YAMLLoadWarning(RuntimeWarning):
41-
pass
42-
43-
def load_warning(method):
44-
if _warnings_enabled['YAMLLoadWarning'] is False:
45-
return
46-
47-
import warnings
48-
49-
message = (
50-
"calling yaml.%s() without Loader=... is deprecated, as the "
51-
"default Loader is unsafe. Please read "
52-
"https://msg.pyyaml.org/load for full details."
53-
) % method
54-
55-
warnings.warn(message, YAMLLoadWarning, stacklevel=3)
26+
return {}
5627

5728
#------------------------------------------------------------------------------
5829
def scan(stream, Loader=Loader):
@@ -100,30 +71,22 @@ def compose_all(stream, Loader=Loader):
10071
finally:
10172
loader.dispose()
10273

103-
def load(stream, Loader=None):
74+
def load(stream, Loader):
10475
"""
10576
Parse the first YAML document in a stream
10677
and produce the corresponding Python object.
10778
"""
108-
if Loader is None:
109-
load_warning('load')
110-
Loader = FullLoader
111-
11279
loader = Loader(stream)
11380
try:
11481
return loader.get_single_data()
11582
finally:
11683
loader.dispose()
11784

118-
def load_all(stream, Loader=None):
85+
def load_all(stream, Loader):
11986
"""
12087
Parse all YAML documents in a stream
12188
and produce corresponding Python objects.
12289
"""
123-
if Loader is None:
124-
load_warning('load_all')
125-
Loader = FullLoader
126-
12790
loader = Loader(stream)
12891
try:
12992
while loader.check_data():

0 commit comments

Comments
 (0)