# Path: Lib/glyphsLib/builder/constants.py
# GLYPHS_PREFIX = "com.schriftgestaltung."
# 
# GLYPHLIB_PREFIX = GLYPHS_PREFIX + "Glyphs."
# 
# PUBLIC_PREFIX = "public."
# 
# UFO2FT_FEATURE_WRITERS_KEY = "com.github.googlei18n.ufo2ft.featureWriters"
# 
# DEFAULT_FEATURE_WRITERS = [
#     {"class": "KernFeatureWriter", "options": {"mode": "append"}},
#     {"class": "MarkFeatureWriter", "options": {"mode": "skip"}},
# ]
# 
# DEFAULT_LAYER_NAME = PUBLIC_PREFIX + "default"


import os
import posixpath
from .constants import (
    GLYPHS_PREFIX,
    GLYPHLIB_PREFIX,
    PUBLIC_PREFIX,
    UFO2FT_FEATURE_WRITERS_KEY,
    DEFAULT_FEATURE_WRITERS,
    DEFAULT_LAYER_NAME,
)
        from glyphsLib.types import BinaryData

    # Save UFO data files
    if ufo.data.fileNames:

        ufo_data = {}
        for os_filename in ufo.data.fileNames:
            filename = posixpath.join(*os_filename.split(os.path.sep))
            ufo_data[filename] = BinaryData(ufo.data[os_filename])
        master.userData[UFO_DATA_KEY] = ufo_data


def to_glyphs_glyph_user_data(self, ufo, glyph):
    key = GLYPH_USER_DATA_KEY + "." + glyph.name
    if key in ufo.lib:
        glyph.userData = ufo.lib[key]


def to_glyphs_layer_lib(self, ufo_layer, master):
    user_data = {}
    for key, value in ufo_layer.lib.items():
        if _user_data_has_no_special_meaning(key):
            user_data[key] = value

    # the default layer may have a custom name
    layer_name = ufo_layer.name
    if (
        ufo_layer is self._sources[master.id].font.layers.defaultLayer
        and layer_name != DEFAULT_LAYER_NAME
    ):
        user_data[LAYER_NAME_KEY] = ufo_layer.name

# Path: Lib/glyphsLib/builder/constants.py
# GLYPHS_PREFIX = "com.schriftgestaltung."
# 
# GLYPHLIB_PREFIX = GLYPHS_PREFIX + "Glyphs."
# 
# PUBLIC_PREFIX = "public."
# 
# UFO2FT_FEATURE_WRITERS_KEY = "com.github.googlei18n.ufo2ft.featureWriters"
# 
# DEFAULT_FEATURE_WRITERS = [
#     {"class": "KernFeatureWriter", "options": {"mode": "append"}},
#     {"class": "MarkFeatureWriter", "options": {"mode": "skip"}},
# ]
# 
# DEFAULT_LAYER_NAME = PUBLIC_PREFIX + "default"


# Path: Lib/glyphsLib/builder/user_data.py
import os
import posixpath
from .constants import (
    GLYPHS_PREFIX,
    GLYPHLIB_PREFIX,
    PUBLIC_PREFIX,
    UFO2FT_FEATURE_WRITERS_KEY,
    DEFAULT_FEATURE_WRITERS,
    DEFAULT_LAYER_NAME,
)
        from glyphsLib.types import BinaryData


    # Save UFO data files
    if ufo.data.fileNames:

        ufo_data = {}
        for os_filename in ufo.data.fileNames:
            filename = posixpath.join(*os_filename.split(os.path.sep))
            ufo_data[filename] = BinaryData(ufo.data[os_filename])
        master.userData[UFO_DATA_KEY] = ufo_data


def to_glyphs_glyph_user_data(self, ufo, glyph):
    key = GLYPH_USER_DATA_KEY + "." + glyph.name
    if key in ufo.lib:
        glyph.userData = ufo.lib[key]


def to_glyphs_layer_lib(self, ufo_layer, master):
    user_data = {}
    for key, value in ufo_layer.lib.items():
        if _user_data_has_no_special_meaning(key):
            user_data[key] = value

    # the default layer may have a custom name
    layer_name = ufo_layer.name
    if (
        ufo_layer is self._sources[master.id].font.layers.defaultLayer
        and layer_name != DEFAULT_LAYER_NAME
    ):
        user_data[LAYER_NAME_KEY] = ufo_layer.name

        layer_name = DEFAULT_LAYER_NAME