updated ApiClient of python sdk.

When create api instance, if we don't pass the `api_client` parameter,
then use the default api_client in `config` module.
This commit is contained in:
geekerzp
2015-05-25 14:31:55 +08:00
parent 095771d345
commit 3beeb6125e
8 changed files with 66 additions and 8 deletions

View File

@@ -31,11 +31,16 @@ from ..util import remove_none
from ..swagger import ApiClient
from .. import config
{{#operations}}
class {{classname}}(object):
def __init__(self, api_client):
self.api_client = api_client
def __init__(self, api_client=None):
if api_client:
self.api_client = api_client
else:
self.api_client = config.api_client
{{#operation}}
def {{nickname}}(self, {{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}**kwargs):
"""

View File

@@ -0,0 +1,8 @@
from __future__ import absolute_import
from .swagger import ApiClient
# Configuration variables
api_client = ApiClient("{{basePath}}")