From 9ca5a583329298ef1344faf90bf78ea27b941f94 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Mon, 3 Jun 2019 00:46:44 -0700 Subject: [PATCH] Delete processed layer when --write-default-layer option is used Fixes #171 --- python/psautohint/ufoFont.py | 7 ++++++- tests/integration/data | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/psautohint/ufoFont.py b/python/psautohint/ufoFont.py index 579332e1e..2a57fb995 100644 --- a/python/psautohint/ufoFont.py +++ b/python/psautohint/ufoFont.py @@ -435,7 +435,12 @@ def save(self, path): # Write layer contents. layers = writer.layerContents.copy() - if self.processedLayerGlyphMap or not self.writeToDefaultLayer: + if self.writeToDefaultLayer and PROCESSED_LAYER_NAME in layers: + # Delete processed glyphs directory + writer.deleteGlyphSet(PROCESSED_LAYER_NAME) + # Remove entry from 'layercontents.plist' file + del layers[PROCESSED_LAYER_NAME] + elif self.processedLayerGlyphMap or not self.writeToDefaultLayer: layers[PROCESSED_LAYER_NAME] = PROCESSED_GLYPHS_DIRNAME writer.layerContents.update(layers) writer.writeLayerContents() diff --git a/tests/integration/data b/tests/integration/data index 4a0174218..83a3b1be4 160000 --- a/tests/integration/data +++ b/tests/integration/data @@ -1 +1 @@ -Subproject commit 4a0174218500aca85a7c73dcae260a124e054707 +Subproject commit 83a3b1be4c3c797a1704be0f06b0124f1b59c546