(baseURL, html)
| 97 | self.printed = True |
| 98 | |
| 99 | def parse(baseURL, html): |
| 100 | global failures |
| 101 | # look for broken unicode |
| 102 | if not reValidChar.match(html): |
| 103 | print(' WARNING: invalid characters detected in: %s' % baseURL) |
| 104 | failures = True |
| 105 | return [], [] |
| 106 | |
| 107 | parser = FindHyperlinks(baseURL) |
| 108 | try: |
| 109 | parser.feed(html) |
| 110 | parser.close() |
| 111 | except: |
| 112 | # TODO: Python's html.parser is now always lenient, which is no good for us: we want correct HTML in our javadocs |
| 113 | parser.printFile() |
| 114 | print(' WARNING: failed to parse %s:' % baseURL) |
| 115 | traceback.print_exc(file=sys.stdout) |
| 116 | failures = True |
| 117 | return [], [] |
| 118 | |
| 119 | #print ' %d links, %d anchors' % \ |
| 120 | # (len(parser.links), len(parser.anchors)) |
| 121 | return parser.links, parser.anchors |
| 122 | |
| 123 | failures = False |
| 124 |
no test coverage detected
searching dependent graphs…