-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add enums to types/__init__.py (#695)
- Loading branch information
1 parent
2e38473
commit e1d4a4a
Showing
1 changed file
with
15 additions
and
6 deletions.
There are no files selected for viewing
21 changes: 15 additions & 6 deletions
21
gapic/templates/%namespace/%name_%version/%sub/types/__init__.py.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
{% extends '_base.py.j2' %} | ||
|
||
{% block content %} | ||
{% for p in api.protos.values() if p.file_to_generate and p.messages -%} | ||
from .{{p.module_name }} import ({% for m in p.messages.values() %}{{ m.name }}, {% endfor %}) | ||
{% endfor %} | ||
{%- for proto in api.protos.values() if proto.file_to_generate and proto.messages %} | ||
from .{{proto.module_name }} import ( | ||
{%- for message in proto.messages.values() %} | ||
{{message.name }}, {% endfor %} | ||
{%- for enum in proto.enums.values() %} | ||
{{ enum.name }}, {% endfor %} | ||
){% endfor %} | ||
|
||
__all__ = ( | ||
{%- for p in api.protos.values() if p.file_to_generate %}{% for m in p.messages.values() %} | ||
'{{ m.name }}', | ||
{%- endfor %}{% endfor %} | ||
{%- for proto in api.protos.values() if proto.file_to_generate %} | ||
{%- for message in proto.messages.values() %} | ||
'{{ message.name }}', | ||
{%- endfor -%} | ||
{%- for enum in proto.enums.values() %} | ||
'{{ enum.name }}', | ||
{%- endfor -%} | ||
{%- endfor %} | ||
) | ||
{% endblock %} |