Build System: Enable python3 compatibility.

* Consistently use spaces in rest-api-templates/asterisk_processor.py.
* Exclude third-party from docs/full-en_US.xml.
* Add docs/full-en_US.xml to .gitignore.
* Use list() to convert python3 view.
* Use python3 print function.
* Replace cmp() with equivalent equation.
* Replace reference to out of scope subtype variable with name
  parameter.
* Use unescaping triple bracket notation in mustache templates where
  needed.  This causes behavior of Python2 to be maintained when using
  Python3.
* Fix references to has_websocket / is_websocket in
  res_ari_resource.c.mustache.
* Update calculation of has_websocket to use any().
* Use unicode mode for writing output file in transform.py.
* Replace 'from swagger_model import *' with explicit import of required
  symbols.
* Add missing 'import os'
* Fix invalid reference to swagger_version from exception handler.

I have not tested voicemailpwcheck.py, only the print syntax has
been fixed.

Change-Id: If5c5b556a2800d41a3e2cfef080ac2e151178c33
This commit is contained in:
Corey Farrell
2018-03-23 07:49:59 -04:00
parent dcac292ae3
commit 7593359787
11 changed files with 50 additions and 45 deletions

View File

@@ -20,9 +20,10 @@
Asterisk RESTful HTTP binding code.
"""
import os
import re
from swagger_model import *
from swagger_model import Stringify, SwaggerError, SwaggerPostProcessor
try:
from collections import OrderedDict
@@ -182,7 +183,7 @@ class AsteriskProcessor(SwaggerPostProcessor):
raise SwaggerError(
"Should not mix resources in one API declaration", context)
# root_path isn't needed any more
resource_api.root_path = resource_api.root_path.children()[0]
resource_api.root_path = list(resource_api.root_path.children())[0]
if resource_api.name != resource_api.root_path.name:
raise SwaggerError(
"API declaration name should match", context)
@@ -205,10 +206,10 @@ class AsteriskProcessor(SwaggerPostProcessor):
def process_parameter(self, parameter, context):
if parameter.param_type == 'body':
parameter.is_body_parameter = True;
parameter.is_body_parameter = True;
parameter.c_data_type = 'struct ast_json *'
else:
parameter.is_body_parameter = False;
parameter.is_body_parameter = False;
if not parameter.data_type in self.type_mapping:
raise SwaggerError(
"Invalid parameter type %s" % parameter.data_type, context)