Skip to content

Commit 704aff7

Browse files
authored
Merge pull request #6 from AltSchool/ALTOS-24049-py3.7
Rename async keyword for py3.7 compatibility
2 parents a80211c + cce8ae6 commit 704aff7

File tree

8 files changed

+504
-491
lines changed

8 files changed

+504
-491
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 3.0.3 (2018-08-22)
2+
* Removes double call in setup.py
3+
* Adjusts EventsResponse so that event metadata is returned
4+
* Renames async keyword to async_ to allow Python 3.7 support
5+
16
## 3.0.2 (2018-07-16)
27
* Removes implicit relative imports which are not supported in Python 3
38

clever/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.2
1+
3.0.3

clever/api_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,12 @@ def __deserialize(self, data, klass):
278278
def call_api(self, resource_path, method,
279279
path_params=None, query_params=None, header_params=None,
280280
body=None, post_params=None, files=None,
281-
response_type=None, auth_settings=None, async=None,
281+
response_type=None, auth_settings=None, async_=None,
282282
_return_http_data_only=None, collection_formats=None, _preload_content=True,
283283
_request_timeout=None):
284284
"""
285285
Makes the HTTP request (synchronous) and return the deserialized data.
286-
To make an async request, set the async parameter.
286+
To make an async request, set the async_ parameter.
287287
288288
:param resource_path: Path to method endpoint.
289289
:param method: Method to call.
@@ -298,7 +298,7 @@ def call_api(self, resource_path, method,
298298
:param response: Response data type.
299299
:param files dict: key -> filename, value -> filepath,
300300
for `multipart/form-data`.
301-
:param async bool: execute request asynchronously
301+
:param async_ bool: execute request asynchronously
302302
:param _return_http_data_only: response data without head status code and headers
303303
:param collection_formats: dict of collection formats for path, query,
304304
header, and post parameters.
@@ -307,13 +307,13 @@ def call_api(self, resource_path, method,
307307
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request
308308
timeout. It can also be a pair (tuple) of (connection, read) timeouts.
309309
:return:
310-
If async parameter is True,
310+
If async_ parameter is True,
311311
the request will be called asynchronously.
312312
The method will return the request thread.
313-
If parameter async is False or missing,
313+
If parameter async_ is False or missing,
314314
then the method will return the response directly.
315315
"""
316-
if not async:
316+
if not async_:
317317
return self.__call_api(resource_path, method,
318318
path_params, query_params, header_params,
319319
body, post_params, files,

clever/apis/data_api.py

Lines changed: 459 additions & 459 deletions
Large diffs are not rendered by default.

clever/apis/events_api.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ def get_event(self, id, **kwargs):
3939
"""
4040
Returns the specific event
4141
This method makes a synchronous HTTP request by default. To make an
42-
asynchronous HTTP request, please pass async=True
43-
>>> thread = api.get_event(id, async=True)
42+
asynchronous HTTP request, please pass async_=True
43+
>>> thread = api.get_event(id, async_=True)
4444
>>> result = thread.get()
4545
46-
:param async bool
46+
:param async_ bool
4747
:param str id: (required)
4848
:return: EventResponse
4949
If the method is called asynchronously,
5050
returns the request thread.
5151
"""
5252
kwargs['_return_http_data_only'] = True
53-
if kwargs.get('async'):
53+
if kwargs.get('async_'):
5454
return self.get_event_with_http_info(id, **kwargs)
5555
else:
5656
(data) = self.get_event_with_http_info(id, **kwargs)
@@ -60,19 +60,19 @@ def get_event_with_http_info(self, id, **kwargs):
6060
"""
6161
Returns the specific event
6262
This method makes a synchronous HTTP request by default. To make an
63-
asynchronous HTTP request, please pass async=True
64-
>>> thread = api.get_event_with_http_info(id, async=True)
63+
asynchronous HTTP request, please pass async_=True
64+
>>> thread = api.get_event_with_http_info(id, async_=True)
6565
>>> result = thread.get()
6666
67-
:param async bool
67+
:param async_ bool
6868
:param str id: (required)
6969
:return: EventResponse
7070
If the method is called asynchronously,
7171
returns the request thread.
7272
"""
7373

7474
all_params = ['id']
75-
all_params.append('async')
75+
all_params.append('async_')
7676
all_params.append('_return_http_data_only')
7777
all_params.append('_preload_content')
7878
all_params.append('_request_timeout')
@@ -121,7 +121,7 @@ def get_event_with_http_info(self, id, **kwargs):
121121
files=local_var_files,
122122
response_type='EventResponse',
123123
auth_settings=auth_settings,
124-
async=params.get('async'),
124+
async_=params.get('async_'),
125125
_return_http_data_only=params.get('_return_http_data_only'),
126126
_preload_content=params.get('_preload_content', True),
127127
_request_timeout=params.get('_request_timeout'),
@@ -131,11 +131,11 @@ def get_events(self, **kwargs):
131131
"""
132132
Returns a list of events
133133
This method makes a synchronous HTTP request by default. To make an
134-
asynchronous HTTP request, please pass async=True
135-
>>> thread = api.get_events(async=True)
134+
asynchronous HTTP request, please pass async_=True
135+
>>> thread = api.get_events(async_=True)
136136
>>> result = thread.get()
137137
138-
:param async bool
138+
:param async_ bool
139139
:param int limit:
140140
:param str starting_after:
141141
:param str ending_before:
@@ -146,7 +146,7 @@ def get_events(self, **kwargs):
146146
returns the request thread.
147147
"""
148148
kwargs['_return_http_data_only'] = True
149-
if kwargs.get('async'):
149+
if kwargs.get('async_'):
150150
return self.get_events_with_http_info(**kwargs)
151151
else:
152152
(data) = self.get_events_with_http_info(**kwargs)
@@ -156,11 +156,11 @@ def get_events_with_http_info(self, **kwargs):
156156
"""
157157
Returns a list of events
158158
This method makes a synchronous HTTP request by default. To make an
159-
asynchronous HTTP request, please pass async=True
160-
>>> thread = api.get_events_with_http_info(async=True)
159+
asynchronous HTTP request, please pass async_=True
160+
>>> thread = api.get_events_with_http_info(async_=True)
161161
>>> result = thread.get()
162162
163-
:param async bool
163+
:param async_ bool
164164
:param int limit:
165165
:param str starting_after:
166166
:param str ending_before:
@@ -172,7 +172,7 @@ def get_events_with_http_info(self, **kwargs):
172172
"""
173173

174174
all_params = ['limit', 'starting_after', 'ending_before', 'school', 'record_type']
175-
all_params.append('async')
175+
all_params.append('async_')
176176
all_params.append('_return_http_data_only')
177177
all_params.append('_preload_content')
178178
all_params.append('_request_timeout')
@@ -227,7 +227,7 @@ def get_events_with_http_info(self, **kwargs):
227227
files=local_var_files,
228228
response_type='EventsResponse',
229229
auth_settings=auth_settings,
230-
async=params.get('async'),
230+
async_=params.get('async_'),
231231
_return_http_data_only=params.get('_return_http_data_only'),
232232
_preload_content=params.get('_preload_content', True),
233233
_request_timeout=params.get('_request_timeout'),

override/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.2
1+
3.0.3

override/api_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,12 @@ def __deserialize(self, data, klass):
282282
def call_api(self, resource_path, method,
283283
path_params=None, query_params=None, header_params=None,
284284
body=None, post_params=None, files=None,
285-
response_type=None, auth_settings=None, async=None,
285+
response_type=None, auth_settings=None, async_=None,
286286
_return_http_data_only=None, collection_formats=None, _preload_content=True,
287287
_request_timeout=None):
288288
"""
289289
Makes the HTTP request (synchronous) and return the deserialized data.
290-
To make an async request, set the async parameter.
290+
To make an async request, set the async_ parameter.
291291
292292
:param resource_path: Path to method endpoint.
293293
:param method: Method to call.
@@ -302,7 +302,7 @@ def call_api(self, resource_path, method,
302302
:param response: Response data type.
303303
:param files dict: key -> filename, value -> filepath,
304304
for `multipart/form-data`.
305-
:param async bool: execute request asynchronously
305+
:param async_ bool: execute request asynchronously
306306
:param _return_http_data_only: response data without head status code and headers
307307
:param collection_formats: dict of collection formats for path, query,
308308
header, and post parameters.
@@ -311,13 +311,13 @@ def call_api(self, resource_path, method,
311311
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request
312312
timeout. It can also be a pair (tuple) of (connection, read) timeouts.
313313
:return:
314-
If async parameter is True,
314+
If async_ parameter is True,
315315
the request will be called asynchronously.
316316
The method will return the request thread.
317-
If parameter async is False or missing,
317+
If parameter async_ is False or missing,
318318
then the method will return the response directly.
319319
"""
320-
if not async:
320+
if not async_:
321321
return self.__call_api(resource_path, method,
322322
path_params, query_params, header_params,
323323
body, post_params, files,

override/override.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ rm -rf swagger_client || true
88
git grep -l 'swagger_client' -- './*' ':(exclude)override/override.sh' | xargs sed -i "" 's/swagger_client/clever/g'
99
git grep -l 'swagger-client' -- './*' ':(exclude)override/override.sh' | xargs sed -i "" 's/swagger-client/clever-python/g'
1010

11+
# Rename references of async to async_
12+
git grep -l "param async" -- './*' ':(exclude)override/override.sh' | xargs sed -i "" "s/param async/param async_/g"
13+
git grep -l "parameter async" -- './*' ':(exclude)override/override.sh' | xargs sed -i "" "s/parameter async/parameter async_/g"
14+
git grep -l "async parameter" -- './*' ':(exclude)override/override.sh' | xargs sed -i "" "s/async parameter/async_ parameter/g"
15+
git grep -l "async=" -- './*' ':(exclude)override/override.sh' | xargs sed -i "" "s/async=/async_=/g"
16+
git grep -l "async:" -- './*' ':(exclude)override/override.sh' | xargs sed -i "" "s/async:/async_:/g"
17+
git grep -l "('async')" -- './*' ':(exclude)override/override.sh' | xargs sed -i "" "s/('async')/('async_')/g"
18+
1119
# Update the README
1220
mv README.md docs/README.md
1321
sed -i "" 's/## Documentation for API Endpoints/<EOD>\'$'\n## Documentation for API Endpoints/g' docs/README.md

0 commit comments

Comments
 (0)