Exemple #1
0
 def createNamespace(self, name, path, builtin=False):
     # Build one unique name
     counter = 1
     name = textutils.slugify(name)
     while name in self._namespaces:
         name = textutils.slugify("%s %d" % (name, counter))
         counter += 1
     return Namespace(name, path, builtin)
Exemple #2
0
def text_to_iconname(value, prefix="", sufix=""):
    """&Text Button name -> %{prefix}-text-button-name-%{sufix}"""
    if prefix:
        value = "%s %s" % (prefix, value)
    if sufix:
        value = "%s %s" % (value, sufix)
    return textutils.slugify(value.replace("&", ""))