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

Class FilterDnsCdnDomainCommand

xtools.py:160–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158
159
160class FilterDnsCdnDomainCommand(sublime_plugin.TextCommand):
161 def run(self, edit):
162 buffers = get_buffer_text(self.view)
163
164 text = buffers
165 black_text = []
166 for line in buffers.split('\n'):
167 for fd in filter_domains:
168 if fd in line or fd == line:
169 text = text.replace(line + '\n', '')
170 black_text.append(fd)
171
172 black_text = '\n'.join(list(set(black_text)))
173 text = "{0}\n\n# filter host:\n{1}".format(text,black_text)
174 update_file(self.view, edit, text)
175
176
177# URL And Router

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected