MCPcopy Create free account
hub / github.com/chasingboy/Xtools / select_domain

Function select_domain

utils.py:194–207  ·  view source on GitHub ↗
(view)

Source from the content-addressed store, hash-verified

192
193
194def 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
210def select_rootdomain(text):

Callers 1

runMethod · 0.85

Calls 1

select_rootdomainFunction · 0.85

Tested by

no test coverage detected