Skip to content

Commit 15e336b

Browse files
committed
Merge pull request #1123 from wing328/python_typo
[Python] better wording for documentation
2 parents 698ed97 + 68f61d9 commit 15e336b

File tree

24 files changed

+149
-66
lines changed

24 files changed

+149
-66
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public PythonClientCodegen() {
6161
"return", "def", "for", "lambda", "try"));
6262

6363
cliOptions.clear();
64-
cliOptions.add(new CliOption("packageName", "python package name (convension: under_score), default: swagger_client"));
64+
cliOptions.add(new CliOption("packageName", "python package name (convention: snake_case), default: swagger_client"));
6565
cliOptions.add(new CliOption("packageVersion", "python package version, default: 1.0.0"));
6666
}
6767

modules/swagger-codegen/src/main/resources/python/api.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class {{classname}}(object):
3434
"""
3535
NOTE: This class is auto generated by the swagger code generator program.
3636
Do not edit the class manually.
37+
Ref: https://github.com/swagger-api/swagger-codegen
3738
"""
3839

3940
def __init__(self, api_client=None):
@@ -51,7 +52,7 @@ class {{classname}}(object):
5152
{{{summary}}}
5253
{{{notes}}}
5354

54-
This method makes a synchronous HTTP request by default.To make an
55+
This method makes a synchronous HTTP request by default. To make an
5556
asynchronous HTTP request, please define a `callback` function
5657
to be invoked when receiving the response.
5758
>>> def callback_function(response):

modules/swagger-codegen/src/main/resources/python/api_client.mustache

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Copyright 2015 SmartBear Software
1414
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
17+
18+
ref: https://github.com/swagger-api/swagger-codegen
1719
"""
1820

1921
from __future__ import absolute_import
@@ -56,7 +58,7 @@ class ApiClient(object):
5658
templates.
5759

5860
NOTE: This class is auto generated by the swagger code generator program.
59-
https://github.com/swagger-api/swagger-codegen
61+
Ref: https://github.com/swagger-api/swagger-codegen
6062
Do not edit the class manually.
6163

6264
:param host: The base path for the server to call.
@@ -75,7 +77,7 @@ class ApiClient(object):
7577
self.host = host
7678
self.cookie = cookie
7779
# Set default User-Agent.
78-
self.user_agent = 'Python-Swagger'
80+
self.user_agent = 'Python-Swagger/{{packageVersion}}'
7981

8082
@property
8183
def user_agent(self):
@@ -280,7 +282,8 @@ class ApiClient(object):
280282
body=None, post_params=None, files=None,
281283
response_type=None, auth_settings=None, callback=None):
282284
"""
283-
Makes the HTTP request and return the deserialized data.
285+
Makes the HTTP request (synchronous) and return the deserialized data.
286+
To make an async request, define a function for callback.
284287

285288
:param resource_path: Path to method endpoint.
286289
:param method: Method to call.
@@ -450,9 +453,8 @@ class ApiClient(object):
450453

451454
def __deserialize_file(self, response):
452455
"""
453-
Saves response body into a file in (the defined) temporary folder,
454-
using the filename from the `Content-Disposition` header if provided,
455-
otherwise a random filename.
456+
Saves response body into a file in a temporary folder,
457+
using the filename from the `Content-Disposition` header if provided.
456458

457459
:param response: RESTResponse.
458460
:return: file path.

modules/swagger-codegen/src/main/resources/python/configuration.mustache

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Copyright 2015 SmartBear Software
1414
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
17+
18+
ref: https://github.com/swagger-api/swagger-codegen
1719
"""
1820

1921
from __future__ import absolute_import
@@ -44,7 +46,7 @@ def singleton(cls, *args, **kw):
4446
class Configuration(object):
4547
"""
4648
NOTE: This class is auto generated by the swagger code generator program.
47-
https://github.com/swagger-api/swagger-codegen
49+
Ref: https://github.com/swagger-api/swagger-codegen
4850
Do not edit the class manually.
4951
"""
5052

@@ -56,7 +58,7 @@ class Configuration(object):
5658
self.host = "{{basePath}}"
5759
# Default api client
5860
self.api_client = None
59-
# Temp file folder for download
61+
# Temp file folder for downloading files
6062
self.temp_folder_path = None
6163

6264
# Authentication Settings
@@ -139,7 +141,7 @@ class Configuration(object):
139141

140142
def get_basic_auth_token(self):
141143
"""
142-
Gets basic auth header string.
144+
Gets HTTP basic authentication header (string).
143145

144146
:return: The token for basic HTTP authentication.
145147
"""

modules/swagger-codegen/src/main/resources/python/model.mustache

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Copyright 2015 SmartBear Software
1414
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
17+
18+
Ref: https://github.com/swagger-api/swagger-codegen
1719
"""
1820

1921
{{#models}}
@@ -29,7 +31,7 @@ class {{classname}}(object):
2931
"""
3032
def __init__(self):
3133
"""
32-
Swagger model
34+
{{classname}} - a model defined in Swagger
3335

3436
:param dict swaggerTypes: The key is attribute name
3537
and the value is attribute type.
@@ -82,7 +84,7 @@ class {{classname}}(object):
8284
{{/vars}}
8385
def to_dict(self):
8486
"""
85-
Return model properties dict
87+
Returns the model properties as a dict
8688
"""
8789
result = {}
8890

@@ -102,7 +104,7 @@ class {{classname}}(object):
102104

103105
def to_str(self):
104106
"""
105-
Return model properties str
107+
Returns the string representation of the model
106108
"""
107109
return pformat(self.to_dict())
108110

modules/swagger-codegen/src/main/resources/python/setup.mustache

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ VERSION = "{{packageVersion}}"
88

99
{{#apiInfo}}{{#apis}}{{^hasMore}}
1010

11-
# To install the library, open a Terminal shell, then run this
12-
# file by typing:
11+
# To install the library, run the following
1312
#
1413
# python setup.py install
1514
#
16-
# You need to have the setuptools module installed.
17-
# Try reading the setuptools documentation:
15+
# prerequisite: setuptools
1816
# http://pypi.python.org/pypi/setuptools
1917

2018
REQUIRES = ["urllib3 >= 1.10", "six >= 1.9", "certifi", "python-dateutil"]
3.83 KB
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Collecting nose (from -r dev-requirements.txt (line 1))
2+
Using cached nose-1.3.7-py2-none-any.whl
3+
Collecting tox (from -r dev-requirements.txt (line 2))
4+
Using cached tox-2.1.1-py2.py3-none-any.whl
5+
Collecting coverage (from -r dev-requirements.txt (line 3))
6+
Collecting randomize (from -r dev-requirements.txt (line 4))
7+
Using cached randomize-0.13-py2.py3-none-any.whl
8+
Collecting virtualenv>=1.11.2 (from tox->-r dev-requirements.txt (line 2))
9+
Using cached virtualenv-13.1.2-py2.py3-none-any.whl
10+
Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2))
11+
Using cached py-1.4.30-py2.py3-none-any.whl
12+
Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2))
13+
Using cached pluggy-0.3.0-py2.py3-none-any.whl
14+
Installing collected packages: nose, virtualenv, py, pluggy, tox, coverage, randomize
15+
Successfully installed coverage-3.7.1 nose-1.3.7 pluggy-0.3.0 py-1.4.30 randomize-0.13 tox-2.1.1 virtualenv-13.1.2

samples/client/petstore/python/setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88

99

1010

11-
# To install the library, open a Terminal shell, then run this
12-
# file by typing:
11+
# To install the library, run the following
1312
#
1413
# python setup.py install
1514
#
16-
# You need to have the setuptools module installed.
17-
# Try reading the setuptools documentation:
15+
# prerequisite: setuptools
1816
# http://pypi.python.org/pypi/setuptools
1917

2018
REQUIRES = ["urllib3 >= 1.10", "six >= 1.9", "certifi", "python-dateutil"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Metadata-Version: 1.0
2+
Name: swagger-client
3+
Version: 1.0.0
4+
Summary: Swagger Petstore
5+
Home-page: UNKNOWN
6+
Author: UNKNOWN
7+
Author-email: [email protected]
8+
License: UNKNOWN
9+
Description: This is a sample server Petstore server. You can find out more about Swagger at &lt;a href=\&quot;http://swagger.io\&quot;&gt;http://swagger.io&lt;/a&gt; or on irc.freenode.net, #swagger. For this sample, you can use the api key \&quot;special-key\&quot; to test the authorization filters
10+
11+
Keywords: Swagger,Swagger Petstore
12+
Platform: UNKNOWN

0 commit comments

Comments
 (0)