diff --git a/.flake8 b/.flake8 index 2807825..4e6f7e1 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] -ignore = E402,F401,F403 +ignore = E402,F401,F403,F405,W503 exclude = .git, __pycache__, diff --git a/ciscosparkapi/api/organizations.py b/ciscosparkapi/api/organizations.py index e234807..760182e 100644 --- a/ciscosparkapi/api/organizations.py +++ b/ciscosparkapi/api/organizations.py @@ -92,7 +92,7 @@ def __init__(self, session): self._session = session @generator_container - def list(self, max=None, **request_parameters): + def list(self, max=None, **request_parameters): """List Organizations. This method supports Cisco Spark's implementation of RFC5988 Web diff --git a/ciscosparkapi/api/people.py b/ciscosparkapi/api/people.py index f77e6fc..e327523 100644 --- a/ciscosparkapi/api/people.py +++ b/ciscosparkapi/api/people.py @@ -254,15 +254,15 @@ def create(self, emails, displayName=None, firstName=None, lastName=None, check_type(licenses, list) post_data = dict_from_items_with_values( - request_parameters, - emails=emails, - displayName=displayName, - firstName=firstName, - lastName=lastName, - avatar=avatar, - orgId=orgId, - roles=roles, - licenses=licenses, + request_parameters, + emails=emails, + displayName=displayName, + firstName=firstName, + lastName=lastName, + avatar=avatar, + orgId=orgId, + roles=roles, + licenses=licenses, ) # API request @@ -342,15 +342,15 @@ def update(self, personId, emails=None, displayName=None, firstName=None, check_type(licenses, list) put_data = dict_from_items_with_values( - request_parameters, - emails=emails, - displayName=displayName, - firstName=firstName, - lastName=lastName, - avatar=avatar, - orgId=orgId, - roles=roles, - licenses=licenses, + request_parameters, + emails=emails, + displayName=displayName, + firstName=firstName, + lastName=lastName, + avatar=avatar, + orgId=orgId, + roles=roles, + licenses=licenses, ) # API request diff --git a/ciscosparkapi/api/rooms.py b/ciscosparkapi/api/rooms.py index ac45b5f..77591c5 100644 --- a/ciscosparkapi/api/rooms.py +++ b/ciscosparkapi/api/rooms.py @@ -199,9 +199,9 @@ def create(self, title, teamId=None, **request_parameters): check_type(teamId, basestring) post_data = dict_from_items_with_values( - request_parameters, - title=title, - teamId=teamId, + request_parameters, + title=title, + teamId=teamId, ) # API request @@ -253,8 +253,8 @@ def update(self, roomId, title=None, **request_parameters): check_type(roomId, basestring) put_data = dict_from_items_with_values( - request_parameters, - title=title, + request_parameters, + title=title, ) # API request diff --git a/ciscosparkapi/api/teams.py b/ciscosparkapi/api/teams.py index d325a53..d3e16d9 100644 --- a/ciscosparkapi/api/teams.py +++ b/ciscosparkapi/api/teams.py @@ -138,7 +138,7 @@ def list(self, max=None, **request_parameters): for item in items: yield Team(item) - def create(self, name, **request_parameters): + def create(self, name, **request_parameters): """Create a team. The authenticated user is automatically added as a member of the team. diff --git a/ciscosparkapi/exceptions.py b/ciscosparkapi/exceptions.py index e9b8cc4..94a632b 100644 --- a/ciscosparkapi/exceptions.py +++ b/ciscosparkapi/exceptions.py @@ -68,11 +68,11 @@ def response_to_string(response): # Prepare request components req = textwrap.fill("{} {}".format(request.method, request.url), width=79, - subsequent_indent=' ' * (len(request.method)+1)) + subsequent_indent=' ' * (len(request.method) + 1)) req_headers = [ textwrap.fill("{}: {}".format(*sanitize(header)), width=79, - subsequent_indent=' '*4) + subsequent_indent=' ' * 4) for header in request.headers.items() ] req_body = (textwrap.fill(to_unicode(request.body), width=79) @@ -83,10 +83,10 @@ def response_to_string(response): response.reason if response.reason else ""), width=79, - subsequent_indent=' ' * (len(request.method)+1)) + subsequent_indent=' ' * (len(request.method) + 1)) resp_headers = [ textwrap.fill("{}: {}".format(*header), width=79, - subsequent_indent=' '*4) + subsequent_indent=' ' * 4) for header in response.headers.items() ] resp_body = textwrap.fill(response.text, width=79) if response.text else "" diff --git a/ciscosparkapi/responsecodes.py b/ciscosparkapi/responsecodes.py index ff24cea..ef4129c 100644 --- a/ciscosparkapi/responsecodes.py +++ b/ciscosparkapi/responsecodes.py @@ -34,7 +34,7 @@ "present that specifies how many seconds you need to wait before a " "successful request can be made.", 500: "Something went wrong on the server.", - 503: "The server received an invalid response from an upstream server " + 502: "The server received an invalid response from an upstream server " "while processing the request. Try again later.", 503: "Server is overloaded with requests. Try again later." }