From e16c55a110a5cde3bf5c83a156195b5d71481488 Mon Sep 17 00:00:00 2001 From: Vilem Duha Date: Thu, 25 Apr 2019 22:35:26 +0200 Subject: BlenderKit: Oauth browser login. No more hassle with API keys for the users. Needs testing. renamed get_bkit_url to get_api_url task queue is a new simple module to do tasks, more timed tasks should come here instead of being in assetbar as of now. (download, search checks and more) --- blenderkit/paths.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'blenderkit/paths.py') diff --git a/blenderkit/paths.py b/blenderkit/paths.py index 71479c7e..1595ad78 100644 --- a/blenderkit/paths.py +++ b/blenderkit/paths.py @@ -18,9 +18,10 @@ import bpy, os, sys -BLENDERKIT_API_LOCAL = "http://localhost:8001/api/v1/" -BLENDERKIT_API_MAIN = "https://www.blenderkit.com/api/v1/" -BLENDERKIT_API_DEVEL = "https://devel.blenderkit.com/api/v1/" +BLENDERKIT_LOCAL = "http://localhost:8001" +BLENDERKIT_MAIN = "https://www.blenderkit.com" +BLENDERKIT_DEVEL = "https://devel.blenderkit.com" +BLENDERKIT_API = "/api/v1/" BLENDERKIT_REPORT_URL = "usage_report/" BLENDERKIT_USER_ASSETS = "https://www.blenderkit.com/my-assets" BLENDERKIT_PLANS = "https://www.blenderkit.com/plans/pricing/" @@ -38,14 +39,24 @@ def get_bkit_url(): d = bpy.app.debug_value # d = 2 if d == 1: - url = BLENDERKIT_API_LOCAL + url = BLENDERKIT_LOCAL elif d == 2: - url = BLENDERKIT_API_DEVEL + url = BLENDERKIT_DEVEL else: - url = BLENDERKIT_API_MAIN + url = BLENDERKIT_MAIN return url +def get_api_url(): + return get_bkit_url() + BLENDERKIT_API + + +def default_global_dict(): + from os.path import expanduser + home = expanduser("~") + return home + os.sep + 'blenderkit_data' + + def get_categories_filepath(): tempdir = get_temp_dir() return os.path.join(tempdir, 'categories.json') -- cgit v1.2.3