Skip to content

Commit 6875e3a

Browse files
authored
Merge pull request #727 from antonrh/isort-integration
2 parents 406653f + 3e58284 commit 6875e3a

File tree

93 files changed

+344
-315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+344
-315
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ clean-build:
3434
@rm -fr dist/
3535
@rm -fr *.egg-info
3636

37+
format fmt:
38+
isort --recursive oauthlib tests
39+
40+
lint:
41+
isort --recursive --check-only --diff oauthlib tests
42+
3743
test:
3844
tox
3945

oauthlib/common.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
import re
1313
import time
1414
import urllib.parse as urlparse
15+
from urllib.parse import (
16+
quote as _quote, unquote as _unquote, urlencode as _urlencode,
17+
)
18+
1519
from . import get_debug
16-
from urllib.parse import quote as _quote
17-
from urllib.parse import unquote as _unquote
18-
from urllib.parse import urlencode as _urlencode
1920

2021
try:
2122
from secrets import randbits

oauthlib/oauth1/__init__.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
This module is a wrapper for the most recent implementation of OAuth 1.0 Client
77
and Server classes.
88
"""
9-
from .rfc5849 import Client
10-
from .rfc5849 import SIGNATURE_HMAC, SIGNATURE_HMAC_SHA1, SIGNATURE_HMAC_SHA256, SIGNATURE_RSA, SIGNATURE_PLAINTEXT
11-
from .rfc5849 import SIGNATURE_TYPE_AUTH_HEADER, SIGNATURE_TYPE_QUERY
12-
from .rfc5849 import SIGNATURE_TYPE_BODY
9+
from .rfc5849 import (
10+
SIGNATURE_HMAC, SIGNATURE_HMAC_SHA1, SIGNATURE_HMAC_SHA256,
11+
SIGNATURE_PLAINTEXT, SIGNATURE_RSA, SIGNATURE_TYPE_AUTH_HEADER,
12+
SIGNATURE_TYPE_BODY, SIGNATURE_TYPE_QUERY, Client,
13+
)
14+
from .rfc5849.endpoints import (
15+
AccessTokenEndpoint, AuthorizationEndpoint, RequestTokenEndpoint,
16+
ResourceEndpoint, SignatureOnlyEndpoint, WebApplicationServer,
17+
)
18+
from .rfc5849.errors import (
19+
InsecureTransportError, InvalidClientError, InvalidRequestError,
20+
InvalidSignatureMethodError, OAuth1Error,
21+
)
1322
from .rfc5849.request_validator import RequestValidator
14-
from .rfc5849.endpoints import RequestTokenEndpoint, AuthorizationEndpoint
15-
from .rfc5849.endpoints import AccessTokenEndpoint, ResourceEndpoint
16-
from .rfc5849.endpoints import SignatureOnlyEndpoint, WebApplicationServer
17-
from .rfc5849.errors import InsecureTransportError, InvalidClientError, InvalidRequestError, InvalidSignatureMethodError, OAuth1Error

oauthlib/oauth1/rfc5849/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@
99
import base64
1010
import hashlib
1111
import logging
12-
log = logging.getLogger(__name__)
13-
1412
import urllib.parse as urlparse
1513

16-
from oauthlib.common import Request, urlencode, generate_nonce
17-
from oauthlib.common import generate_timestamp, to_unicode
14+
from oauthlib.common import (
15+
Request, generate_nonce, generate_timestamp, to_unicode, urlencode,
16+
)
17+
1818
from . import parameters, signature
1919

20+
log = logging.getLogger(__name__)
21+
22+
23+
2024
SIGNATURE_HMAC_SHA1 = "HMAC-SHA1"
2125
SIGNATURE_HMAC_SHA256 = "HMAC-SHA256"
2226
SIGNATURE_HMAC = SIGNATURE_HMAC_SHA1
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
from .access_token import AccessTokenEndpoint
2+
from .authorization import AuthorizationEndpoint
13
from .base import BaseEndpoint
24
from .request_token import RequestTokenEndpoint
3-
from .authorization import AuthorizationEndpoint
4-
from .access_token import AccessTokenEndpoint
55
from .resource import ResourceEndpoint
66
from .signature_only import SignatureOnlyEndpoint
7-
from .pre_configured import WebApplicationServer
7+
8+
from .pre_configured import WebApplicationServer # isort:skip

oauthlib/oauth1/rfc5849/endpoints/authorization.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
This module is an implementation of various logic needed
77
for signing and checking OAuth 1.0 RFC 5849 requests.
88
"""
9-
from oauthlib.common import Request, add_params_to_uri
9+
from urllib.parse import urlencode
10+
11+
from oauthlib.common import add_params_to_uri
1012

1113
from .. import errors
1214
from .base import BaseEndpoint
13-
from urllib.parse import urlencode
1415

1516

1617
class AuthorizationEndpoint(BaseEndpoint):

oauthlib/oauth1/rfc5849/endpoints/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010

1111
from oauthlib.common import CaseInsensitiveDict, Request, generate_token
1212

13-
from .. import (CONTENT_TYPE_FORM_URLENCODED, SIGNATURE_HMAC_SHA1, SIGNATURE_HMAC_SHA256, SIGNATURE_RSA,
14-
SIGNATURE_TYPE_AUTH_HEADER, SIGNATURE_TYPE_BODY,
15-
SIGNATURE_TYPE_QUERY, errors, signature, utils)
13+
from .. import (
14+
CONTENT_TYPE_FORM_URLENCODED, SIGNATURE_HMAC_SHA1, SIGNATURE_HMAC_SHA256,
15+
SIGNATURE_RSA, SIGNATURE_TYPE_AUTH_HEADER, SIGNATURE_TYPE_BODY,
16+
SIGNATURE_TYPE_QUERY, errors, signature, utils,
17+
)
1618

1719

1820
class BaseEndpoint:

oauthlib/oauth1/rfc5849/endpoints/pre_configured.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
from . import (AccessTokenEndpoint, AuthorizationEndpoint,
2-
RequestTokenEndpoint, ResourceEndpoint)
1+
from . import (
2+
AccessTokenEndpoint, AuthorizationEndpoint, RequestTokenEndpoint,
3+
ResourceEndpoint,
4+
)
35

46

57
class WebApplicationServer(RequestTokenEndpoint, AuthorizationEndpoint,

oauthlib/oauth1/rfc5849/parameters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
88
.. _`section 3.5`: https://tools.ietf.org/html/rfc5849#section-3.5
99
"""
10+
from urllib.parse import urlparse, urlunparse
11+
1012
from oauthlib.common import extract_params, urlencode
1113

1214
from . import utils
1315

14-
from urllib.parse import urlparse, urlunparse
15-
1616

1717
# TODO: do we need filter_params now that oauth_params are handled by Request?
1818
# We can easily pass in just oauth protocol params.

oauthlib/oauth1/rfc5849/request_validator.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
This module is an implementation of various logic needed
77
for signing and checking OAuth 1.0 RFC 5849 requests.
88
"""
9-
import sys
10-
119
from . import SIGNATURE_METHODS, utils
1210

1311

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy