diff options
author | xiubuzhe <xiubuzhe@sina.com> | 2023-10-10 18:42:56 +0800 |
---|---|---|
committer | xiubuzhe <xiubuzhe@sina.com> | 2023-10-10 18:42:56 +0800 |
commit | 761f7e6618b74d4818348b64c96c263dfa31fb03 (patch) | |
tree | 0a79e3cb2ffcf0f439bfb8cef405ba9dab69c5ab /lib/yaml/loader.py | |
parent | 8cf6546b260ad2e2690e34a625ca2fce8c62fa23 (diff) | |
download | sunhpc-761f7e6618b74d4818348b64c96c263dfa31fb03.tar.gz sunhpc-761f7e6618b74d4818348b64c96c263dfa31fb03.tar.bz2 sunhpc-761f7e6618b74d4818348b64c96c263dfa31fb03.zip |
add yumrepos,mpi,ntfs,nvidia,openmpi,schrodinger
Diffstat (limited to 'lib/yaml/loader.py')
-rw-r--r-- | lib/yaml/loader.py | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/lib/yaml/loader.py b/lib/yaml/loader.py new file mode 100644 index 0000000..e90c112 --- /dev/null +++ b/lib/yaml/loader.py @@ -0,0 +1,63 @@ + +__all__ = ['BaseLoader', 'FullLoader', 'SafeLoader', 'Loader', 'UnsafeLoader'] + +from .reader import * +from .scanner import * +from .parser import * +from .composer import * +from .constructor import * +from .resolver import * + +class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + BaseConstructor.__init__(self) + BaseResolver.__init__(self) + +class FullLoader(Reader, Scanner, Parser, Composer, FullConstructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + FullConstructor.__init__(self) + Resolver.__init__(self) + +class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + SafeConstructor.__init__(self) + Resolver.__init__(self) + +class Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + Constructor.__init__(self) + Resolver.__init__(self) + +# UnsafeLoader is the same as Loader (which is and was always unsafe on +# untrusted input). Use of either Loader or UnsafeLoader should be rare, since +# FullLoad should be able to load almost all YAML safely. Loader is left intact +# to ensure backwards compatibility. +class UnsafeLoader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + Constructor.__init__(self) + Resolver.__init__(self) |