From e119bab55593a9432173996ed447a2c30dc4af1c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 21 Nov 2014 06:29:01 -0800 Subject: [PATCH] auto-switch tweaks. --- dotfiles/cider/bootstrap.json | 2 +- dotfiles/emacs.d | 2 +- dotfiles/lib/python/wifi_auto_switch.py | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dotfiles/cider/bootstrap.json b/dotfiles/cider/bootstrap.json index 8ede011c..6df331d1 100644 --- a/dotfiles/cider/bootstrap.json +++ b/dotfiles/cider/bootstrap.json @@ -28,7 +28,6 @@ ], "formulas": [ "ack", - "ag", "ant", "autoconf", "automake", @@ -114,6 +113,7 @@ "sleuthkit", "sqlite", "subversion", + "the_silver_searcher", "tig", "tmux", "unzip", diff --git a/dotfiles/emacs.d b/dotfiles/emacs.d index 5759aa7e..beb7e30f 160000 --- a/dotfiles/emacs.d +++ b/dotfiles/emacs.d @@ -1 +1 @@ -Subproject commit 5759aa7ec6d5710d2b53cdbdaa231019d5099426 +Subproject commit beb7e30fad3d39882820a1d0164ff7fc45c24c10 diff --git a/dotfiles/lib/python/wifi_auto_switch.py b/dotfiles/lib/python/wifi_auto_switch.py index 7461bb47..910ebfb7 100644 --- a/dotfiles/lib/python/wifi_auto_switch.py +++ b/dotfiles/lib/python/wifi_auto_switch.py @@ -90,7 +90,15 @@ class OSXSSIDToRSSI(object): return get_stdout_from_command(['airport', '--scan', '--xml']) def _get_scan_tree(self): - return etree.fromstring(self._get_scan_xml()) + xml = self._get_scan_xml() + for i in range(10): + if xml: + break + xml = self._get_scan_xml() + else: + Exception("Airport command did not provide output.") + return etree.fromstring(xml) + _network_xpb = dxpb.array.dict _ssid_xpb = xpb.key.text_contains_("SSID_STR")