Lib/extractFea/ft2fea.py
def makeName(*names, **kwargs):
    """
        Return a string with all positional arguments joined by a "_" underscore.

        NOTE: for named glyph classes maximum length is 30 in fea. So inputs
              should not be too long.

        Keyword arguments:
            prefix: string; prepended to the result; default: ''
            suffix: string; appended to the result; default: ''
            unique: bool; When True return a different string for each call,
                    even with the same input arguments, requires "uniquenessDict";
                    default: False
            uniquenessDict: dict; used to store the uniqueness information
                            of calls where "unique=true";
                            default: None

        NOTE: you can use functools.partial to create a customized makeName
        function that call this function with preset keyword:

            from functools import partial
            myMakeName = functools.partial(uniquenessDict={})

        And then pass the new function to functions that require a uniquenessDict:

            formatLookupGPOS(lookup, makeName=myMakeName)

        A uniquenessDict is currently required to make unique anchor-class names.
    """
    # python 2 compatible "only keyword" arguments
    prefix = kwargs.get('prefix', '')
    suffix = kwargs.get('suffix', '')
    unique = kwargs.get('unique', False)
    uniquenessDict = kwargs.get('uniquenessDict', None)

    if unique and uniquenessDict is None:
        raise TypeError('When "unique" is True "uniquenessDict" must be provided')
    init = names[0]
    base = ''
    if len(names) > 1:
        base = '_{0}'.format('_'.join(str(name) for name in names[1:]))

    placeholder = '' if not unique else '{uid}'
    name = '{prefix}{init}{uid}{base}{suffix}'.format(
        prefix=prefix,
        suffix=suffix,
        init=init,
        base=base,
        uid=placeholder
    )
    if unique:
        uid = uniquenessDict.get(name, None)
        uid = 0 if uid is None else uid + 1
        uniquenessDict[name] = uid
        name = name.format(uid=uid)
    return name

        Return a string with all positional arguments joined by a "_" underscore.

        NOTE: for named glyph classes maximum length is 30 in fea. So inputs
              should not be too long.

        Keyword arguments:
            prefix: string; prepended to the result; default: ''
            suffix: string; appended to the result; default: ''
            unique: bool; When True return a different string for each call,
                    even with the same input arguments, requires "uniquenessDict";
                    default: False
            uniquenessDict: dict; used to store the uniqueness information
                            of calls where "unique=true";
                            default: None

        NOTE: you can use functools.partial to create a customized makeName
        function that call this function with preset keyword:

            from functools import partial
            myMakeName = functools.partial(uniquenessDict={})

        And then pass the new function to functions that require a uniquenessDict:

            formatLookupGPOS(lookup, makeName=myMakeName)

        A uniquenessDict is currently required to make unique anchor-class names.
    
Return a string with all positional arguments joined by a "_" underscore.
NOTE: for named glyph classes maximum length is 30 in fea. So inputs
should not be too long.



you can use functools.partial to create a customized makeName
function that call this function with preset keyword.

from functools import partial
myMakeName = functools.partial(uniquenessDict={})

And then pass the new function to functions that require a uniquenessDict.



A uniquenessDict is currently required to make unique anchor-class names.
Return a string with all positional arguments joined by a " _ " underscore . NOTE : for named glyph classes maximum length is 30 in fea . So inputs should not be too long . you can use functools . partial to create a customized makeName function that call this function with preset keyword . from functools import partial myMakeName = functools . partial ( uniquenessDict = {} ) And then pass the new function to functions that require a uniquenessDict . A uniquenessDict is currently required to make unique anchor - class names .
def makeName(*names, **kwargs):
    prefix = kwargs.get('prefix', '')
    suffix = kwargs.get('suffix', '')
    unique = kwargs.get('unique', False)
    uniquenessDict = kwargs.get('uniquenessDict', None)
    if unique and uniquenessDict is None:
        raise TypeError('When "unique" is True "uniquenessDict" must be provided')
    init = names[0]
    base = ''
    if len(names) > 1:
        base = '_{0}'.format('_'.join(str(name) for name in names[1:]))
    placeholder = '' if not unique else '{uid}'
    name = '{prefix}{init}{uid}{base}{suffix}'.format(
        prefix=prefix,
        suffix=suffix,
        init=init,
        base=base,
        uid=placeholder
    )
    if unique:
        uid = uniquenessDict.get(name, None)
        uid = 0 if uid is None else uid + 1
        uniquenessDict[name] = uid
        name = name.format(uid=uid)
    return name
def makeName ( * names , ** kwargs ) : prefix = kwargs . get ( 'prefix' , '' ) suffix = kwargs . get ( 'suffix' , '' ) unique = kwargs . get ( 'unique' , False ) uniquenessDict = kwargs . get ( 'uniquenessDict' , None ) if unique and uniquenessDict is None : raise TypeError ( 'When "unique" is True "uniquenessDict" must be provided' ) init = names [ 0 ] base = '' if len ( names ) > 1 : base = '_{0}' . format ( '_' . join ( str ( name ) for name in names [ 1 : ] ) ) placeholder = '' if not unique else '{uid}' name = '{prefix}{init}{uid}{base}{suffix}' . format ( prefix = prefix , suffix = suffix , init = init , base = base , uid = placeholder ) if unique : uid = uniquenessDict . get ( name , None ) uid = 0 if uid is None else uid + 1 uniquenessDict [ name ] = uid name = name . format ( uid = uid ) return name
Return a string with all positional arguments joined by a "_" underscore.
Return a string with all positional arguments joined by a " _ " underscore .
"""
        Return a string with all positional arguments joined by a "_" underscore.

        NOTE: for named glyph classes maximum length is 30 in fea. So inputs
              should not be too long.

        Keyword arguments:
            prefix: string; prepended to the result; default: ''
            suffix: string; appended to the result; default: ''
            unique: bool; When True return a different string for each call,
                    even with the same input arguments, requires "uniquenessDict";
                    default: False
            uniquenessDict: dict; used to store the uniqueness information
                            of calls where "unique=true";
                            default: None

        NOTE: you can use functools.partial to create a customized makeName
        function that call this function with preset keyword:

            from functools import partial
            myMakeName = functools.partial(uniquenessDict={})

        And then pass the new function to functions that require a uniquenessDict:

            formatLookupGPOS(lookup, makeName=myMakeName)

        A uniquenessDict is currently required to make unique anchor-class names.
    """ # python 2 compatible "only keyword" arguments