diff options
author | Vilem Duha <vilem.duha@gmail.com> | 2019-04-25 23:35:26 +0300 |
---|---|---|
committer | Vilem Duha <vilem.duha@gmail.com> | 2019-05-19 16:45:48 +0300 |
commit | e16c55a110a5cde3bf5c83a156195b5d71481488 (patch) | |
tree | f902eae2914f0dc2759957e862d96e79843982ac /blenderkit/paths.py | |
parent | d2808959bb845ec945aa7fac494db42a9228021b (diff) |
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)
Diffstat (limited to 'blenderkit/paths.py')
-rw-r--r-- | blenderkit/paths.py | 23 |
1 files changed, 17 insertions, 6 deletions
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') |