MCPcopy Create free account
hub / github.com/ComfyWorkflows/ComfyUI-Launcher / slugify

Function slugify

server/utils.py:28–42  ·  view source on GitHub ↗

Taken from https://github.com/django/django/blob/master/django/utils/text.py Convert to ASCII if 'allow_unicode' is False. Convert spaces or repeated dashes to single dashes. Remove characters that aren't alphanumerics, underscores, or hyphens. Convert to lowercase. Also strip leadi

(value, allow_unicode=False)

Source from the content-addressed store, hash-verified

26 return False
27
28def slugify(value, allow_unicode=False):
29 """
30 Taken from https://github.com/django/django/blob/master/django/utils/text.py
31 Convert to ASCII if 'allow_unicode' is False. Convert spaces or repeated
32 dashes to single dashes. Remove characters that aren't alphanumerics,
33 underscores, or hyphens. Convert to lowercase. Also strip leading and
34 trailing whitespace, dashes, and underscores.
35 """
36 value = str(value)
37 if allow_unicode:
38 value = unicodedata.normalize('NFKC', value)
39 else:
40 value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
41 value = re.sub(r'[^\w\s-]', '', value.lower())
42 return re.sub(r'[-\s]+', '-', value).strip('-_')
43
44
45COMFYUI_REPO_URL = "https://github.com/comfyanonymous/ComfyUI.git"

Callers 2

create_projectFunction · 0.90
import_projectFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected