MCPcopy Create free account
hub / github.com/apenwarr/sshuttle / save_servers

Method save_servers

ui-macos/main.py:309–327  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

307 self.serversController.setSelectionIndex_(0)
308
309 def save_servers(self):
310 l = []
311 for s in self.servers:
312 host = s.host()
313 if not host: continue
314 nets = []
315 for n in s.nets():
316 subnet = n.subnet()
317 if not subnet: continue
318 nets.append((subnet, n.width()))
319 d = dict(host=s.host(),
320 nets=nets,
321 autoNets=s.autoNets(),
322 autoHosts=s.autoHosts(),
323 useDns=s.useDns(),
324 latencyControl=s.latencyControl())
325 l.append(d)
326 my.Defaults().setObject_forKey_(l, 'servers')
327 self.fill_menu()
328
329 def awakeFromNib(self):
330 self.routingField.removeAllItems()

Callers

nothing calls this directly

Calls 9

fill_menuMethod · 0.95
hostMethod · 0.80
netsMethod · 0.80
subnetMethod · 0.80
widthMethod · 0.80
autoNetsMethod · 0.80
autoHostsMethod · 0.80
useDnsMethod · 0.80
latencyControlMethod · 0.80

Tested by

no test coverage detected