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)
| 14 | |
| 15 | |
| 16 | def 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 | |
| 34 | class Output: |
no outgoing calls
no test coverage detected
searching dependent graphs…