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

Method run

xtools.py:143–157  ·  view source on GitHub ↗
(self, edit)

Source from the content-addressed store, hash-verified

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 2

get_buffer_textFunction · 0.85
update_fileFunction · 0.85

Tested by

no test coverage detected