Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2022-02-23 04:45:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2022-02-23 04:45:38 +0300
commit593c699b2a50213263e706d34753a9e25ac1a26f (patch)
tree2471724e2fa55ceebae155857d01b82199e93fa2
parent601b76c4927bffe97b72925383e266c49ce10ff5 (diff)
Fix T95962: Sapling Addon now broken because of license header
Load the first non-blank, non-comment line so files with licenses are supported.
-rw-r--r--add_curve_sapling/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/add_curve_sapling/__init__.py b/add_curve_sapling/__init__.py
index 585bd50e..bead5ee7 100644
--- a/add_curve_sapling/__init__.py
+++ b/add_curve_sapling/__init__.py
@@ -182,7 +182,10 @@ class ImportData(Operator):
f = open(os.path.join(getPresetpaths()[0], self.filename), 'r')
except (FileNotFoundError, IOError):
f = open(os.path.join(getPresetpaths()[1], self.filename), 'r')
- settings = f.readline()
+ # Find the first non-comment, non-blank line, this must contain preset text (all on one line).
+ for settings in f:
+ if settings and (not settings.startswith("#")):
+ break
f.close()
# print(settings)
settings = ast.literal_eval(settings)