Skip to content

Commit f8d2cbd

Browse files
committed
Lots of little tweaks
1 parent 269036a commit f8d2cbd

29 files changed

+86
-79
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ from amadeus import Client
5353

5454
[TBD]
5555

56-
## How to contribute to the Amadeus Ruby Gem
56+
## How to contribute to the Amadeus Python SDK
5757

5858
#### **Did you find a bug?**
5959

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The MIT License (MIT)
2-
Copyright (c) 2017 Amadeus IT Group SA
2+
Copyright (c) 2018 Amadeus IT Group SA
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
55
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ run:
1919
coverage html
2020

2121
lint:
22-
flake8 $(SOURCES) --exit-zero --max-complexity 5
22+
flake8 $(SOURCES) --exit-zero
2323

2424
docs:
2525
rm -rf _docs

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Module Version](https://badge.fury.io/py/amadeus.svg)](https://badge.fury.io/py/amadeus)
44
[![Build Status](http://img.shields.io/travis/amadeus4dev/amadeus-python.svg)][travis]
55
[![Maintainability](https://api.codeclimate.com/v1/badges/c2e19cf9628d6f4aece2/maintainability)](https://codeclimate.com/github/amadeus4dev/amadeus-python/maintainability)
6-
[![Dependencies](.github/images/dependencies.svg)](gem)
6+
[![Dependencies](.github/images/dependencies.svg)](ttps://badge.fury.io/py/amadeus)
77
[![Contact Support](.github/images/support.svg)][support]
88

99
Amadeus provides a set of APIs for the travel industry. Flights, Hotels, Locations and more.
@@ -12,7 +12,7 @@ For more details see the [Python documentation](https://developer.amadeus.com/do
1212

1313
## Installation
1414

15-
This gem requires Python 2.7+ or 3.3+. You can install install it directly with pip.
15+
This SDK requires Python 2.7+ or 3.3+. You can install install it directly with pip.
1616

1717
```sh
1818
pip install amadeus

amadeus/amadeus.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55

66

77
class Client(Namespaces, Pagination, Validator, HTTP, object):
8-
"""
8+
'''
99
The Amadeus client library for accessing
1010
the travel APIs.
11-
"""
11+
'''
1212

1313
# The available hosts for this API
1414
HOSTS = {
15-
'test': 'test.api.amadeus.com',
16-
'production': 'production.api.amadeus.com'
15+
'test': 'test.api.amadeus.com',
16+
'production': 'production.api.amadeus.com'
1717
}
1818

1919
# The initialization method for the entire module
2020
def __init__(self, **options):
21-
"""
21+
'''
2222
Initialize using your credentials:
2323
2424
.. code-block:: python
@@ -74,7 +74,7 @@ def __init__(self, **options):
7474
:paramtype ssl: bool
7575
7676
:raises ValueError: when a required param is missing
77-
"""
77+
'''
7878
self._initialize_client_credentials(options)
7979
self._initialize_logger(options)
8080
self._initialize_host(options)

amadeus/client/access_token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(self, client):
1515

1616
# The bearer token that can be used directly in API request headers
1717
def _bearer_token(self):
18-
return "Bearer {0}".format(self.__token())
18+
return 'Bearer {0}'.format(self.__token())
1919

2020
# PRIVATE
2121

amadeus/client/errors.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class ResponseError(RuntimeError):
5-
"""
5+
'''
66
An Amadeus error
77
88
:var response: The response object containing the raw HTTP response and
@@ -16,7 +16,7 @@ class ResponseError(RuntimeError):
1616
1717
:var description: The content of the response that describes the error
1818
:vartype description: str
19-
"""
19+
'''
2020

2121
def __init__(self, response):
2222
self.response = response
@@ -49,42 +49,42 @@ def __determine_code(self):
4949

5050

5151
class NetworkError(ResponseError):
52-
"""
52+
'''
5353
This error occurs when there is some kind of error in the network
54-
"""
54+
'''
5555
pass
5656

5757

5858
class ParserError(ResponseError):
59-
"""
59+
'''
6060
This error occurs when the response type was JSOn but could not be parsed
61-
"""
61+
'''
6262
pass
6363

6464

6565
class ServerError(ResponseError):
66-
"""
66+
'''
6767
This error occurs when there is an error on the server
68-
"""
68+
'''
6969
pass
7070

7171

7272
class ClientError(ResponseError):
73-
"""
73+
'''
7474
This error occurs when the client did not provide the right parameters
75-
"""
75+
'''
7676
pass
7777

7878

7979
class AuthenticationError(ResponseError):
80-
"""
80+
'''
8181
This error occurs when the client did not provide the right credentials
82-
"""
82+
'''
8383
pass
8484

8585

8686
class NotFoundError(ResponseError):
87-
"""
87+
'''
8888
This error occurs when the path could not be found
89-
"""
89+
'''
9090
pass

amadeus/client/location.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
class Location(object):
3-
"""
3+
'''
44
A list of location types, as used in searching for locations
55
66
.. code-block:: python
@@ -16,7 +16,7 @@ class Location(object):
1616
:cvar AIRPORT: ``"AIRPORT"``
1717
:cvar CITY: ``"CITY"``
1818
:cvar ANY: ``"AIRPORT,CITY"``
19-
"""
19+
'''
2020
# Airport
2121
AIRPORT = 'AIRPORT'
2222
# City

amadeus/client/request.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Support Ruby 2 and 3 API calls without importing
1+
# Support Python 2 and 3 API calls without importing
22
# a 3rd party library
33
try:
44
from urllib.request import Request as HTTPRequest
@@ -9,7 +9,7 @@
99

1010

1111
class Request(object):
12-
"""
12+
'''
1313
An object containing all the compiled information about the request made.
1414
1515
:var host: The host used for this API call
@@ -51,7 +51,7 @@ class Request(object):
5151
5252
:var app_version: The custom app version used for this request
5353
:vartype app_version: str
54-
"""
54+
'''
5555

5656
def __init__(self, options):
5757
self.http_request = None
@@ -86,10 +86,10 @@ def __initialize_headers(self):
8686

8787
# Determines the User Agent
8888
def __build_user_agent(self):
89-
user_agent = "amadeus-python/{0}".format(self.client_version)
90-
user_agent += " python/{0}".format(self.language_version)
89+
user_agent = 'amadeus-python/{0}'.format(self.client_version)
90+
user_agent += ' python/{0}'.format(self.language_version)
9191
if self.app_id:
92-
user_agent += " {0}/{1}".format(self.app_id, self.app_version)
92+
user_agent += ' {0}/{1}'.format(self.app_id, self.app_version)
9393
return user_agent
9494

9595
# Builds up a HTTP Request objectm if not akready set
@@ -116,9 +116,9 @@ def _encoded_params(self):
116116

117117
# Builds up the full URL based on the scheme, host, path, and params
118118
def __full_url(self):
119-
full_url = "{0}://{1}{2}".format(self.scheme, self.host, self.path)
119+
full_url = '{0}://{1}{2}'.format(self.scheme, self.host, self.path)
120120
if (self.verb == 'GET'):
121-
full_url += "?{0}".format(self._encoded_params())
121+
full_url += '?{0}'.format(self._encoded_params())
122122
return full_url
123123

124124
# Adds an extra header if the verb is POST

amadeus/client/response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class Response(Parser, object):
5-
"""
5+
'''
66
The response object returned for every API call.
77
88
:var http_response: the raw http response
@@ -25,7 +25,7 @@ class Response(Parser, object):
2525
2626
:var status_code: The HTTP status code for the response, if any
2727
:vartype status_code: int
28-
"""
28+
'''
2929

3030
# Initialize the Response object with the
3131
# HTTPResponse object to parse, the client that made the request

0 commit comments

Comments
 (0)