@autorest/python 6.13.15 → 6.13.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,6 +77,7 @@ class ClientSerializer:
77
77
  ":keyword int polling_interval: Default waiting time between two polls for LRO operations "
78
78
  "if no Retry-After header is present."
79
79
  )
80
+ retval = [s.replace("\\", "\\\\") for s in retval]
80
81
  retval.append('"""')
81
82
  return retval
82
83
 
@@ -17,11 +17,8 @@ def _documentation_string(
17
17
  ) -> List[str]:
18
18
  retval: List[str] = []
19
19
  sphinx_prefix = f":{description_keyword} {prop.client_name}:"
20
- retval.append(
21
- f"{sphinx_prefix} {prop.description(is_operation_file=False)}"
22
- if prop.description(is_operation_file=False)
23
- else sphinx_prefix
24
- )
20
+ description = prop.description(is_operation_file=False).replace("\\", "\\\\")
21
+ retval.append(f"{sphinx_prefix} {description}" if description else sphinx_prefix)
25
22
  retval.append(
26
23
  f":{docstring_type_keyword} {prop.client_name}: {prop.type.docstring_type()}"
27
24
  )
@@ -1,13 +1,13 @@
1
1
 
2
2
  class {{ enum.name }}({{ enum.value_type.type_annotation(is_operation_file=False) }}, Enum, metaclass=CaseInsensitiveEnumMeta):
3
3
  {% if enum.yaml_data.get("description") %}
4
- """{{ enum.yaml_data["description"] | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ') }}
4
+ """{{ op_tools.wrap_string(enum.yaml_data["description"], "\n ") }}
5
5
  """
6
6
  {% endif %}
7
7
 
8
8
  {% for value in enum.values %}
9
9
  {{ value.name }} = {{ enum.value_type.get_declaration(value.value) }}
10
10
  {% if value.description(is_operation_file=False) %}
11
- """{{ value.description(is_operation_file=False) | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ') }}"""
11
+ """{{ op_tools.wrap_string(value.description(is_operation_file=False), "\n ") }}"""
12
12
  {% endif %}
13
13
  {% endfor %}
@@ -1,3 +1,4 @@
1
+ {% import 'operation_tools.jinja2' as op_tools %}
1
2
  # coding=utf-8
2
3
  {{ code_model.options['license_header'] }}
3
4
 
@@ -1,3 +1,4 @@
1
+ {% import 'operation_tools.jinja2' as op_tools %}
1
2
  # coding=utf-8
2
3
  # pylint: disable=too-many-lines
3
4
  {{ code_model.options['license_header'] }}
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
  {{ serializer.declare_model(model) }}
6
- """{{ model.description(is_operation_file=False) | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ') }}
6
+ """{{ op_tools.wrap_string(model.description(is_operation_file=False), "\n ") }}
7
7
  {% if model.discriminated_subtypes %}
8
8
 
9
9
  {{ serializer.discriminator_docstring(model) | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ') }}
@@ -86,5 +86,5 @@
86
86
  setattr(self.properties, key, value)
87
87
  else:
88
88
  super().__setattr__(key, value)
89
- {% endif %}
90
- {% endif %}
89
+ {% endif %}
90
+ {% endif %}
@@ -4,7 +4,7 @@
4
4
  {% set exist_constant = (model.properties | selectattr('constant') | first) is defined %}
5
5
 
6
6
  {{ serializer.declare_model(model) }}
7
- """{{ model.description(is_operation_file=False) | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ') }}
7
+ """{{ op_tools.wrap_string(model.description(is_operation_file=False), "\n ") }}
8
8
  {% if model.discriminated_subtypes %}
9
9
 
10
10
  {{ serializer.discriminator_docstring(model) | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ') }}
@@ -1,4 +1,4 @@
1
- {% macro wrap_string(string, wrapstring, width=95) %}{{ string | wordwrap(width=width, break_long_words=False, break_on_hyphens=False, wrapstring=wrapstring)}}{% endmacro %}
1
+ {% macro wrap_string(string, wrapstring, width=95) %}{{ string | replace("\\", "\\\\") | wordwrap(width=width, break_long_words=False, break_on_hyphens=False, wrapstring=wrapstring)}}{% endmacro %}
2
2
 
3
3
  {% macro description(builder, serializer) %}
4
4
  {% set example_template = serializer.example_template(builder) %}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/python",
3
- "version": "6.13.15",
3
+ "version": "6.13.16",
4
4
  "description": "The Python extension for generators in AutoRest.",
5
5
  "main": "index.js",
6
6
  "repository": {