Skip to content

Commit

Permalink
fix: add enums to types/__init__.py (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 authored Nov 12, 2020
1 parent 2e38473 commit e1d4a4a
Showing 1 changed file with 15 additions and 6 deletions.
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 %}

0 comments on commit e1d4a4a

Please sign in to comment.