BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etsy-python
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
etsy-python
Commits
4eb76b60
Commit
4eb76b60
authored
Sep 01, 2021
by
Forest Godfrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More fixes
parent
40fae0de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
_v2.py
etsy/_v2.py
+1
-0
oauth.py
etsy/oauth.py
+4
-9
No files found.
etsy/_v2.py
View file @
4eb76b60
...
...
@@ -17,6 +17,7 @@ class EtsyV2(API):
super
(
EtsyV2
,
self
)
.
__init__
(
api_key
,
key_file
,
method_cache
,
log
)
def
_get_url
(
self
,
url
,
http_method
,
content_type
,
body
):
print
(
"Getting URL "
+
str
(
url
))
if
self
.
etsy_oauth_client
is
not
None
:
return
self
.
etsy_oauth_client
.
do_oauth_request
(
url
,
http_method
,
...
...
etsy/oauth.py
View file @
4eb76b60
import
oauth2
as
oauth
import
urllib
from
urllib.parse
import
parse_qsl
from
.etsy_env
import
EtsyEnvProduction
from
cgi
import
parse_qsl
from
etsy
.etsy_env
import
EtsyEnvProduction
EtsyOAuthToken
=
oauth
.
Token
...
...
@@ -21,7 +21,7 @@ class EtsyOAuthClient(oauth.Client):
def
get_request_token
(
self
,
**
kwargs
):
request_token_url
=
'
%
s?
%
s'
%
(
self
.
request_token_url
,
urllib
.
parse
.
urlencode
(
kwargs
))
self
.
request_token_url
,
urllib
.
urlencode
(
kwargs
))
resp
,
content
=
self
.
request
(
request_token_url
,
'GET'
)
return
self
.
_get_token
(
content
)
...
...
@@ -43,12 +43,7 @@ class EtsyOAuthClient(oauth.Client):
self
.
token
=
self
.
get_access_token
(
oauth_verifier
)
def
do_oauth_request
(
self
,
url
,
http_method
,
content_type
,
body
):
if
(
content_type
and
content_type
!=
'application/x-www-form-urlencoded'
):
resp
,
content
=
self
.
request
(
url
,
http_method
,
body
=
body
,
headers
=
{
'Content-Type'
:
content_type
})
else
:
resp
,
content
=
self
.
request
(
url
,
http_method
,
body
=
body
)
resp
,
content
=
self
.
request
(
url
,
http_method
,
body
=
body
,
headers
=
{
'Content-Type'
:
content_type
}
if
content_type
else
None
)
if
self
.
logger
:
self
.
logger
.
debug
(
'do_oauth_request: content =
%
r'
%
content
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment