Embed pyhocon into package, and extend parsing capabilities.

This commit is contained in:
allegroai
2019-10-25 15:16:18 +03:00
parent 2104c3ec6b
commit 81cf2d2261
10 changed files with 1707 additions and 15 deletions

View File

@@ -4,8 +4,7 @@ import re
import attr
import six
import pyhocon
from ...utilities.pyhocon import ConfigTree
from .action import Action
@@ -56,7 +55,7 @@ class Service(object):
def parse(self, service_config):
self._default = service_config.get(
"_default", pyhocon.ConfigTree()
"_default", ConfigTree()
).as_plain_ordered_dict()
self._doc = '{} service'.format(self.name)
@@ -64,7 +63,7 @@ class Service(object):
if description:
self._doc += '\n\n{}'.format(description)
self._definitions = service_config.get(
"_definitions", pyhocon.ConfigTree()
"_definitions", ConfigTree()
).as_plain_ordered_dict()
self._definitions_refs = {
k: self._get_schema_references(v) for k, v in self._definitions.items()

View File

@@ -7,7 +7,7 @@ from six.moves.urllib.parse import urlparse, urlunparse
import jwt
import requests
import six
from pyhocon import ConfigTree
from ...utilities.pyhocon import ConfigTree
from requests.auth import HTTPBasicAuth
from .callresult import CallResult