Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

### 2020-xx-xx - 5.5.1
Autorest core version: 3.0.6318

Modelerfour version: 4.15.421

**Bug Fixes**

- Wrap individual enum descriptions #844

### 2020-11-12 - 5.5.0
Autorest core version: 3.0.6318

Expand Down
5 changes: 4 additions & 1 deletion autorest/codegen/templates/enum.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ class {{ enum.name }}(with_metaclass(_CaseInsensitiveEnumMeta, {{ enum.enum_type
{% endif %}

{% for value in enum.values %}
{{ value.name }} = {{ enum.enum_type.get_declaration(value.value) }}{{ " #: " + value.description if value.description else "" }}
{% if value.description %}
#: {{ value.description | wordwrap(width=95, break_long_words=False, wrapstring='\n #: ') }}
{% endif %}
{{ value.name }} = {{ enum.enum_type.get_declaration(value.value) }}
{% endfor %}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class ContentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Content type for upload
"""

APPLICATION_PDF = "application/pdf" #: Content Type 'application/pdf'.
IMAGE_JPEG = "image/jpeg" #: Content Type 'image/jpeg'.
IMAGE_PNG = "image/png" #: Content Type 'image/png'.
IMAGE_TIFF = "image/tiff" #: Content Type 'image/tiff'.
#: Content Type 'application/pdf'.
APPLICATION_PDF = "application/pdf"
#: Content Type 'image/jpeg'.
IMAGE_JPEG = "image/jpeg"
#: Content Type 'image/png'.
IMAGE_PNG = "image/png"
#: Content Type 'image/tiff'.
IMAGE_TIFF = "image/tiff"
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class ContentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Content type for upload
"""

APPLICATION_PDF = "application/pdf" #: Content Type 'application/pdf'.
IMAGE_JPEG = "image/jpeg" #: Content Type 'image/jpeg'.
IMAGE_PNG = "image/png" #: Content Type 'image/png'.
IMAGE_TIFF = "image/tiff" #: Content Type 'image/tiff'.
#: Content Type 'application/pdf'.
APPLICATION_PDF = "application/pdf"
#: Content Type 'image/jpeg'.
IMAGE_JPEG = "image/jpeg"
#: Content Type 'image/png'.
IMAGE_PNG = "image/png"
#: Content Type 'image/tiff'.
IMAGE_TIFF = "image/tiff"
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class ContentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Content type for upload
"""

APPLICATION_PDF = "application/pdf" #: Content Type 'application/pdf'.
IMAGE_JPEG = "image/jpeg" #: Content Type 'image/jpeg'.
IMAGE_PNG = "image/png" #: Content Type 'image/png'.
IMAGE_TIFF = "image/tiff" #: Content Type 'image/tiff'.
#: Content Type 'application/pdf'.
APPLICATION_PDF = "application/pdf"
#: Content Type 'image/jpeg'.
IMAGE_JPEG = "image/jpeg"
#: Content Type 'image/png'.
IMAGE_PNG = "image/png"
#: Content Type 'image/tiff'.
IMAGE_TIFF = "image/tiff"
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class ContentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Content type for upload
"""

APPLICATION_PDF = "application/pdf" #: Content Type 'application/pdf'.
IMAGE_JPEG = "image/jpeg" #: Content Type 'image/jpeg'.
IMAGE_PNG = "image/png" #: Content Type 'image/png'.
IMAGE_TIFF = "image/tiff" #: Content Type 'image/tiff'.
#: Content Type 'application/pdf'.
APPLICATION_PDF = "application/pdf"
#: Content Type 'image/jpeg'.
IMAGE_JPEG = "image/jpeg"
#: Content Type 'image/png'.
IMAGE_PNG = "image/png"
#: Content Type 'image/tiff'.
IMAGE_TIFF = "image/tiff"
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class ContentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Content type for upload
"""

APPLICATION_PDF = "application/pdf" #: Content Type 'application/pdf'.
IMAGE_JPEG = "image/jpeg" #: Content Type 'image/jpeg'.
IMAGE_PNG = "image/png" #: Content Type 'image/png'.
IMAGE_TIFF = "image/tiff" #: Content Type 'image/tiff'.
#: Content Type 'application/pdf'.
APPLICATION_PDF = "application/pdf"
#: Content Type 'image/jpeg'.
IMAGE_JPEG = "image/jpeg"
#: Content Type 'image/png'.
IMAGE_PNG = "image/png"
#: Content Type 'image/tiff'.
IMAGE_TIFF = "image/tiff"
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ class GoblinSharkColor(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
PINK = "pink"
GRAY = "gray"
BROWN = "brown"
UPPER_RED = "RED" #: Uppercase RED.
LOWER_RED = "red" #: Lowercase RED.
#: Uppercase RED.
UPPER_RED = "RED"
#: Lowercase RED.
LOWER_RED = "red"

class MyKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class DaysOfWeekExtensibleEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enu

class IntEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):

ONE = "1" #: one.
TWO = "2" #: two.
THREE = "3" #: three.
#: one.
ONE = "1"
#: two.
TWO = "2"
#: three.
THREE = "3"
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class ContentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Content type for upload
"""

APPLICATION_PDF = "application/pdf" #: Content Type 'application/pdf'.
IMAGE_JPEG = "image/jpeg" #: Content Type 'image/jpeg'.
IMAGE_PNG = "image/png" #: Content Type 'image/png'.
IMAGE_TIFF = "image/tiff" #: Content Type 'image/tiff'.
#: Content Type 'application/pdf'.
APPLICATION_PDF = "application/pdf"
#: Content Type 'image/jpeg'.
IMAGE_JPEG = "image/jpeg"
#: Content Type 'image/png'.
IMAGE_PNG = "image/png"
#: Content Type 'image/tiff'.
IMAGE_TIFF = "image/tiff"