aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/uzbl/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/data/uzbl/scripts')
-rwxr-xr-xexamples/data/uzbl/scripts/uzbl-cookie-daemon (renamed from examples/data/uzbl/scripts/cookie_daemon.py)0
-rwxr-xr-xexamples/data/uzbl/scripts/uzbl-event-manager (renamed from examples/data/uzbl/scripts/event_manager.py)24
-rwxr-xr-xexamples/data/uzbl/scripts/uzbl-tabbed (renamed from examples/data/uzbl/scripts/uzbl_tabbed.py)0
3 files changed, 15 insertions, 9 deletions
diff --git a/examples/data/uzbl/scripts/cookie_daemon.py b/examples/data/uzbl/scripts/uzbl-cookie-daemon
index 87a2e87..87a2e87 100755
--- a/examples/data/uzbl/scripts/cookie_daemon.py
+++ b/examples/data/uzbl/scripts/uzbl-cookie-daemon
diff --git a/examples/data/uzbl/scripts/event_manager.py b/examples/data/uzbl/scripts/uzbl-event-manager
index dee42c5..0054ff6 100755
--- a/examples/data/uzbl/scripts/event_manager.py
+++ b/examples/data/uzbl/scripts/uzbl-event-manager
@@ -45,12 +45,8 @@ from traceback import print_exc
# ::: Default configuration section ::::::::::::::::::::::::::::::::::::::::::
# ============================================================================
-# Automagically set during `make install`
-PREFIX = None
-
-# Check if PREFIX not set and set to default /usr/local/
-if not PREFIX:
- PREFIX = '/usr/local/'
+# `make install` will put the correct value here for your system
+PREFIX = '/usr/local/'
def xdghome(key, default):
'''Attempts to use the environ XDG_*_HOME paths if they exist otherwise
@@ -335,6 +331,10 @@ class EventHandler(object):
class UzblInstance(object):
+
+ # Give all plugins access to the main config dict.
+ config = config
+
def __init__(self, parent, client_socket):
# Internal variables.
@@ -343,6 +343,7 @@ class UzblInstance(object):
self._parent = parent
self._client_socket = client_socket
+ self.depth = 0
self.buffer = ''
# Call the init() function in every plugin. Inside the init function
@@ -397,12 +398,13 @@ class UzblInstance(object):
def send(self, msg):
'''Send a command to the uzbl instance via the socket file.'''
+ msg = msg.strip()
if self._client_socket:
- print '<-- %s' % msg
+ print '%s<-- %s' % (' ' * self.depth, msg)
self._client_socket.send(("%s\n" % msg).encode('utf-8'))
else:
- print '!-- %s' % msg
+ print '%s!-- %s' % (' ' * self.depth, msg)
def connect(self, event, handler, *args, **kargs):
@@ -468,18 +470,22 @@ class UzblInstance(object):
# Silence _printing_ of geo events while debugging.
if event != "GEOMETRY_CHANGED":
- print "--> %s %s %s" % (event, args, '' if not kargs else kargs)
+ print "%s--> %s %s %s" % (' ' * self.depth, event, args,
+ '' if not kargs else kargs)
if event not in self._handlers:
return
for handler in self._handlers[event]:
+ self.depth += 1
try:
self.exec_handler(handler, *args, **kargs)
except:
print_exc()
+ self.depth -= 1
+
def close(self):
'''Close the client socket and clean up.'''
diff --git a/examples/data/uzbl/scripts/uzbl_tabbed.py b/examples/data/uzbl/scripts/uzbl-tabbed
index bb9b9a2..bb9b9a2 100755
--- a/examples/data/uzbl/scripts/uzbl_tabbed.py
+++ b/examples/data/uzbl/scripts/uzbl-tabbed