[Bf-extensions-cvs] [8eead22f] blender-v2.81-release: BlenderKit: Fix T71276 - paths were handled incorrectly Slash at the end of global dir path was causing Global only setting not to work.

Vilém Duha noreply at git.blender.org
Sun Nov 10 21:34:40 CET 2019


Commit: 8eead22f9aec631068919f2f17a620d5336e4105
Author: Vilém Duha
Date:   Sun Nov 10 21:33:06 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rBA8eead22f9aec631068919f2f17a620d5336e4105

BlenderKit: Fix T71276 - paths were handled incorrectly
Slash at the end of global dir path was causing Global only setting not to work.

===================================================================

M	blenderkit/paths.py

===================================================================

diff --git a/blenderkit/paths.py b/blenderkit/paths.py
index 4a9a2cd6..3fc6db5e 100644
--- a/blenderkit/paths.py
+++ b/blenderkit/paths.py
@@ -50,6 +50,7 @@ def get_bkit_url():
         url = BLENDERKIT_MAIN
     return url
 
+
 def find_in_local(text=''):
     fs = []
     for p, d, f in os.walk('.'):
@@ -58,9 +59,11 @@ def find_in_local(text=''):
                 fs.append(file)
     return fs
 
+
 def get_api_url():
     return get_bkit_url() + BLENDERKIT_API
 
+
 def get_oauth_landing_url():
     return get_bkit_url() + BLENDERKIT_OAUTH_LANDING_URL
 
@@ -86,7 +89,7 @@ def get_temp_dir(subdir=None):
     if not os.path.exists(tempdir):
         os.makedirs(tempdir)
     if subdir is not None:
-        tempdir = tempdir + os.sep + subdir
+        tempdir = os.path.join(tempdir, subdir)
         if not os.path.exists(tempdir):
             os.makedirs(tempdir)
     return tempdir
@@ -108,7 +111,7 @@ def get_download_dirs(asset_type):
 
         subdirs = ['brushes', 'textures', 'models', 'scenes', 'materials']
         for subd in subdirs:
-            subdir = ddir + os.sep + subd
+            subdir = os.path.join(ddir, subd)
             if not os.path.exists(subdir):
                 os.makedirs(subdir)
             if subdmapping[asset_type] == subd:
@@ -123,7 +126,7 @@ def get_download_dirs(asset_type):
 
         subdirs = ['textures', 'models', 'scenes', 'materials']  # brushes get stored only globally.
         for subd in subdirs:
-            subdir = ddir + os.sep + subd
+            subdir = os.path.join(ddir, subd)
             if not os.path.exists(subdir):
                 os.makedirs(subdir)
             if subdmapping[asset_type] == subd:



More information about the Bf-extensions-cvs mailing list