Move YAML code to its own module
Code now resides in common.serialization in the form of two new functions: yaml_load and yaml_dump. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import yaml
|
||||
|
||||
try:
|
||||
from yaml import CSafeLoader as SafeLoader
|
||||
except ImportError:
|
||||
from yaml import SafeLoader
|
||||
|
||||
from django.utils.module_loading import import_string
|
||||
|
||||
from mayan.apps.common.serialization import yaml_load
|
||||
|
||||
from .settings import (
|
||||
setting_documentimagecache_storage,
|
||||
setting_documentimagecache_storage_arguments,
|
||||
@@ -18,17 +13,15 @@ from .settings import (
|
||||
storage_documentversion = import_string(
|
||||
dotted_path=setting_storage_backend.value
|
||||
)(
|
||||
**yaml.load(
|
||||
**yaml_load(
|
||||
stream=setting_storage_backend_arguments.value or '{}',
|
||||
Loader=SafeLoader
|
||||
)
|
||||
)
|
||||
|
||||
storage_documentimagecache = import_string(
|
||||
dotted_path=setting_documentimagecache_storage.value
|
||||
)(
|
||||
**yaml.load(
|
||||
**yaml_load(
|
||||
stream=setting_documentimagecache_storage_arguments.value or '{}',
|
||||
Loader=SafeLoader
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user