aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2011-08-07 11:32:05 +0000
committerGravatar Brendan Taylor <whateley@gmail.com>2011-08-07 11:32:05 +0000
commit542e3eb7a7eb77ebfdd73357e1ad219626f23378 (patch)
tree7937da6d6241a085a2d1e8891f9628266f8c3d2a /examples
parent62523673f63f2ac50b64c54a6b20f945117b446a (diff)
don't try to do per-site-settings on non-HTTP URIs
this is mainly to get rid of that annoying (but harmless) traceback
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/data/scripts/per-site-settings.py5
1 files changed, 5 insertions, 0 deletions
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]