From 08885f0a81a1f8d2b0f051d4bb2741a4c81d473d Mon Sep 17 00:00:00 2001 From: Frederik Berlaen Date: Wed, 8 May 2024 12:31:03 +0200 Subject: [PATCH] set instanceDescriptor path on generate fixing #90 --- .../lib/designspaceEditor/ui.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py b/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py index d76ea0b..aa857fd 100644 --- a/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py +++ b/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py @@ -246,6 +246,11 @@ class GenerateInstanceSheet: def __init__(self, parentWindow, operator, instances): self.operator = operator + # update the path attribute in all given instanceDescriptors + for item in instances: + instanceDescriptor = item["object"] + instanceDescriptor.path = os.path.abspath(os.path.join(os.path.dirname(self.operator.path), instanceDescriptor.filename)) + self.instances = instances self.w = vanilla.Sheet((350, 140), parentWindow=parentWindow) @@ -1435,7 +1440,6 @@ def callback(result=True): else: callback() - @coalescingDecorator(delay=0.2) def variableFontsEditorCallback(self, sender): variableFonts = variableFontsParser.parseVariableFonts(sender.get(), self.operator.writerClass.variableFontDescriptorClass) @@ -2000,13 +2004,11 @@ def designspaceEditorInstancesDidChange(self, notification): else: self.instances.list.set([self.wrapInstanceDescriptor(instanceDescriptor) for instanceDescriptor in self.operator.instances]) - - if __name__ == '__main__': pathForBundle = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) designspaceBundle = ExtensionBundle(path=pathForBundle) path = "/Users/frederik/Documents/dev/letterror/mutatorSans/MutatorSans.designspace" # path = "/Users/frederik/Documents/fontsGit/RoboType/RF.designspace" - path = None + # path = None DesignspaceEditorController(path)