From 4fff91efbaf10360e0618338c8cb6ce4795b8f5f Mon Sep 17 00:00:00 2001 From: Vilem Duha Date: Mon, 17 Jun 2019 00:10:54 +0200 Subject: BlenderKit: better reporting for failed uploads bugfix - only fetch server data when not in background(fetching api key during upload procedure is a very bad idea) updatea oauth script. Mention Petr Dlouhy as co-author Temporarily enable Api key field also with oauth on. --- blenderkit/oauth.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'blenderkit/oauth.py') diff --git a/blenderkit/oauth.py b/blenderkit/oauth.py index 220dbed4..3a37318a 100644 --- a/blenderkit/oauth.py +++ b/blenderkit/oauth.py @@ -55,6 +55,7 @@ class SimpleOAuthAuthenticator(object): def get_new_token(self, register=True, redirect_url=None): class HTTPServerHandler(BaseHTTPRequestHandler): + html_template = '%(head)s

%(message)s

' def do_GET(self): self.send_response(200) self.send_header('Content-type', 'text/html') @@ -69,9 +70,11 @@ class SimpleOAuthAuthenticator(object): ) else: redirect_string = "" - self.wfile.write(bytes('%s

You may now close this window.

' % redirect_string, 'utf-8')) + self.wfile.write(bytes(self.html_template % {'head': redirect_string, 'message': 'You may now close this window.'}, 'utf-8')) qs = parse_qs(urlparse(self.path).query) self.server.authorization_code = qs['code'][0] + else: + self.wfile.write(bytes(self.html_template % {'head': '', 'message': 'Authorization failed.'}, 'utf-8')) for port in self.ports: try: -- cgit v1.2.3