From 542e3eb7a7eb77ebfdd73357e1ad219626f23378 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Sun, 7 Aug 2011 11:32:05 +0000 Subject: don't try to do per-site-settings on non-HTTP URIs this is mainly to get rid of that annoying (but harmless) traceback --- examples/data/scripts/per-site-settings.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'examples') diff --git a/examples/data/scripts/per-site-settings.py b/examples/data/scripts/per-site-settings.py index eb9dae7..4afcc7a 100755 --- a/examples/data/scripts/per-site-settings.py +++ b/examples/data/scripts/per-site-settings.py @@ -100,6 +100,11 @@ def write_to_socket(commands, sockpath): if __name__ == '__main__': sockpath = os.environ['UZBL_SOCKET'] url = urlparse.urlparse(os.environ['UZBL_URI']) + + if not url.hostname: + # this is e.g. a file:// URL + exit() + filepath = sys.argv[1] mode = os.stat(filepath)[stat.ST_MODE] -- cgit v1.2.3