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

Class FilterDnsCdnHostCommand

xtools.py:142–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140
141
142class FilterDnsCdnHostCommand(sublime_plugin.TextCommand):
143 def run(self, edit):
144 text = get_buffer_text(self.view)
145 ips = text.replace(' ','').split('\n')
146
147 text = ''
148 black_text = []
149 for ip in ips:
150 if ip in filter_hosts:
151 black_text.append(ip)
152 else:
153 text += ip + '\n'
154
155 black_text = '\n'.join(list(set(black_text)))
156 text = "{0}\n\n# filter host:\n{1}".format(text,black_text)
157 update_file(self.view, edit, text)
158
159
160class FilterDnsCdnDomainCommand(sublime_plugin.TextCommand):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected