[Python] remove singleton (#5012)

* updated tests relying on configuration's singleton

* regenerated samples

* removed singleton from templates

* regenerated samples

* removed broken sample and its test

* reverted accidental change

* regenerated security/ samples

* removed singleton from RESTClientObject

* removed unused Configuration import

* reverted unrelated change

* updated usage examples in api_doc template
This commit is contained in:
baartosz
2017-03-22 14:25:46 +00:00
committed by wing328
parent bea9e265e9
commit 8b891be7d7
30 changed files with 171 additions and 298 deletions

View File

@@ -11,7 +11,6 @@ import re
# python 2 and python 3 compatibility library
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
@@ -24,13 +23,9 @@ class {{classname}}(object):
"""
def __init__(self, api_client=None):
config = Configuration()
if api_client:
self.api_client = api_client
else:
if not config.api_client:
config.api_client = ApiClient()
self.api_client = config.api_client
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
{{#operation}}
def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs):