File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 23
23
setup (
24
24
name = "wordpress-api" ,
25
25
version = VERSION ,
26
- description = "A Python wrapper for the Wordpress and WooCommerce REST APIs with oAuth1a 3leg support" ,
26
+ description = (
27
+ "A Python wrapper for the Wordpress and WooCommerce REST APIs "
28
+ "with oAuth1a 3leg support"
29
+ ),
27
30
long_description = README ,
28
- author = "Claudio Sanches @ Automattic , forked by Derwent @ Laserphile" ,
29
- url = "https://github.com/woocommerce/wc -api-python" ,
31
+ author = "Claudio Sanches @ Automattic, forked by Derwent @ Laserphile" ,
32
+ url = "https://github.com/derwentx/wp -api-python" ,
30
33
license = "MIT License" ,
31
34
packages = [
32
35
"wordpress"
Original file line number Diff line number Diff line change @@ -275,17 +275,25 @@ def discover_auth(self):
275
275
response = self .requester .request ('GET' , discovery_url )
276
276
response_json = response .json ()
277
277
278
- assert \
279
- response_json ['authentication' ], \
280
- "resopnse should include location of authentication resources, resopnse: %s" \
281
- % UrlUtils .beautify_response (response )
278
+ if not 'authentication' in response_json :
279
+ raise UserWarning (
280
+ (
281
+ "Resopnse does not include location of authentication resources.\n "
282
+ "Resopnse: %s\n "
283
+ "Please check you have configured the Wordpress OAuth1 plugin correctly."
284
+ ) % (response )
285
+ )
282
286
283
287
self ._authentication = response_json ['authentication' ]
284
288
285
289
return self ._authentication
286
290
287
291
def get_request_token (self ):
288
- """ Uses the request authentication link to get an oauth_token for requesting an access token """
292
+ """
293
+ Uses the request authentication link to get an oauth_token for
294
+ requesting an access token
295
+ """
296
+
289
297
assert self .consumer_key , "need a valid consumer_key for this step"
290
298
291
299
params = self .get_params ()
You can’t perform that action at this time.
0 commit comments