MCPcopy Create free account
hub / github.com/DenOfEquity/ersatzForge / elem_id

Method elem_id

modules/scripts.py:338–346  ·  view source on GitHub ↗

helper function to generate id for a HTML element, constructs final id out of script name, tab and user-supplied item_id

(self, item_id)

Source from the content-addressed store, hash-verified

336 return ""
337
338 def elem_id(self, item_id):
339 """helper function to generate id for a HTML element, constructs final id out of script name, tab and user-supplied item_id"""
340
341 need_tabname = self.show(True) == self.show(False)
342 tabkind = 'img2img' if self.is_img2img else 'txt2img'
343 tabname = f"{tabkind}_" if need_tabname else ""
344 title = re.sub(r'[^a-z_0-9]', '', re.sub(r'\s', '_', self.title().lower()))
345
346 return f'script_{tabname}{title}_{item_id}'
347
348 def before_hr(self, p, *args):
349 """

Callers 8

uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.95
uiMethod · 0.45
uiMethod · 0.45
uiMethod · 0.45

Calls 2

showMethod · 0.95
titleMethod · 0.95

Tested by

no test coverage detected