Search results page.
(key)
| 2516 | return 'Index of Modules', ''.join(contents) |
| 2517 | |
| 2518 | def html_search(key): |
| 2519 | """Search results page.""" |
| 2520 | # scan for modules |
| 2521 | search_result = [] |
| 2522 | |
| 2523 | def callback(path, modname, desc): |
| 2524 | if modname[-9:] == '.__init__': |
| 2525 | modname = modname[:-9] + ' (package)' |
| 2526 | search_result.append((modname, desc and '- ' + desc)) |
| 2527 | |
| 2528 | with warnings.catch_warnings(): |
| 2529 | warnings.filterwarnings('ignore') # ignore problems during import |
| 2530 | def onerror(modname): |
| 2531 | pass |
| 2532 | ModuleScanner().run(callback, key, onerror=onerror) |
| 2533 | |
| 2534 | # format page |
| 2535 | def bltinlink(name): |
| 2536 | return '<a href="%s.html">%s</a>' % (name, name) |
| 2537 | |
| 2538 | results = [] |
| 2539 | heading = html.heading( |
| 2540 | '<strong class="title">Search Results</strong>', |
| 2541 | ) |
| 2542 | for name, desc in search_result: |
| 2543 | results.append(bltinlink(name) + desc) |
| 2544 | contents = heading + html.bigsection( |
| 2545 | 'key = %s' % key, 'index', '<br>'.join(results)) |
| 2546 | return 'Search Results', contents |
| 2547 | |
| 2548 | def html_topics(): |
| 2549 | """Index of topic texts available.""" |
no test coverage detected
searching dependent graphs…