diff --git a/api_class.mustache b/api_class.mustache index 9364fd6..4901c4c 100644 --- a/api_class.mustache +++ b/api_class.mustache @@ -1,6 +1,8 @@ import zeep +{{#doc}} # {{doc}} +{{/doc}} class {{class_name}}: __module__ = 'skautis' @@ -11,7 +13,9 @@ class {{class_name}}: self._client = zeep.Client('https://is.skaut.cz/JunakWebservice/{{class_name}}.asmx?wsdl') {{#methods}} + {{#doc}} # {{doc}} + {{/doc}} def {{name}}({{def_args}}): return self._client.service.{{name}}({{args}}) diff --git a/skautis_api.mustache b/skautis_api.mustache index 4b2d400..27f2500 100644 --- a/skautis_api.mustache +++ b/skautis_api.mustache @@ -6,7 +6,7 @@ class SkautisApi: def __init__(self, appId, test=False): self._appId = appId self._test = test - + {{#sections}} self.{{module}} = {{class}}(test) {{/sections}} diff --git a/skautis_api_gen.py b/skautis_api_gen.py index 5ed7a88..00783c7 100755 --- a/skautis_api_gen.py +++ b/skautis_api_gen.py @@ -61,9 +61,7 @@ def parse_wsdl(section_url): # extract service documentation doc_tree = tree.find('wsdl:documentation', ns) - main_doc = "No documentation" - if doc_tree is not None: - main_doc = doc_tree.text + main_doc = doc_tree.text if doc_tree is not None else None # load interesting parts of wsdl file ports = tree.find('wsdl:portType', ns) @@ -81,7 +79,7 @@ def parse_wsdl(section_url): for port in ports: # load and check port documentation doc_tag = port.find('wsdl:documentation', ns) - doc = doc_tag.text if doc_tag is not None else "No documentation" + doc = doc_tag.text.strip() if doc_tag is not None else None # load port name name = port.attrib['name']