(view)
| 192 | |
| 193 | |
| 194 | def select_domain(view): |
| 195 | pattern = r'([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+('+top_sufix+'|'+country_sufix+')' |
| 196 | regions = view.find_all(pattern, sublime.IGNORECASE) |
| 197 | |
| 198 | rootdomains = [] |
| 199 | domains = [] |
| 200 | for region in regions: |
| 201 | text = view.substr(region) |
| 202 | domains.append(text) |
| 203 | rootdomains.append(select_rootdomain(text)) |
| 204 | |
| 205 | domains = list(set(domains)) |
| 206 | rootdomains = list(set(rootdomains)) |
| 207 | return sorted(domains), sorted(rootdomains) |
| 208 | |
| 209 | |
| 210 | def select_rootdomain(text): |
no test coverage detected