forked from loafle/openapi-generator-original
Better import for python client.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python
|
||||
"""Add all of the modules in the current directory to __all__"""
|
||||
import os
|
||||
|
||||
# import models into package
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
from .models.{{classname}} import {{classname}}
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
|
||||
# import apis into package
|
||||
{{#apiInfo}}{{#apis}}{{#operations}}
|
||||
from .{{classname}} import {{classname}}
|
||||
{{/operations}}{{/apis}}{{/apiInfo}}
|
||||
|
||||
# import ApiClient
|
||||
from .swagger import ApiClient
|
||||
|
||||
__all__ = []
|
||||
|
||||
for module in os.listdir(os.path.dirname(__file__)):
|
||||
if module != '__init__.py' and module[-3:] == '.py':
|
||||
__all__.append(module[:-3])
|
||||
Reference in New Issue
Block a user