MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / scope2dom

Function scope2dom

pywebio/io_ctrl.py:16–31  ·  view source on GitHub ↗

Get the CSS selector/element name actually used in the front-end html page :param str/tuple name: When it is str, it is regarded as the Dom ID name; when tuple, the format is (css selector, element name)

(name, no_css_selector=False)

Source from the content-addressed store, hash-verified

14
15
16def scope2dom(name, no_css_selector=False):
17 """Get the CSS selector/element name actually used in the front-end html page
18
19 :param str/tuple name: When it is str, it is regarded as the Dom ID name;
20 when tuple, the format is (css selector, element name)
21 """
22 selector = '#'
23 if isinstance(name, tuple):
24 selector, name = name
25
26 name = name.replace(' ', '-')
27
28 if no_css_selector:
29 selector = ''
30
31 return '%spywebio-scope-%s' % (selector, name)
32
33
34class Output:

Callers 12

__enter__Method · 0.85
set_scopeFunction · 0.85
clearFunction · 0.85
removeFunction · 0.85
scroll_toFunction · 0.85
_get_output_specFunction · 0.85
put_scopeFunction · 0.85
appendMethod · 0.85
insertMethod · 0.85
outputFunction · 0.85
popupFunction · 0.85
__exit__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…