summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2016-01-30 16:55:53 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2016-01-30 16:55:53 +0000
commit5340700eee4a0e31c20874b5e69ae7a0e014d866 (patch)
tree644f4831f84198eddebad3d22bcb971e87b70e43
parentdc03da3959e903af4d119481ab3a5d89f3192b22 (diff)
parent4e66f108a5eaedf83acbe2026d0ed74805195fcc (diff)
Merge branch 'master' into testing
-rw-r--r--alot/addressbook/__init__.py2
-rw-r--r--alot/ui.py16
-rw-r--r--docs/source/usage/synopsis.rst5
3 files changed, 22 insertions, 1 deletions
diff --git a/alot/addressbook/__init__.py b/alot/addressbook/__init__.py
index f649b523..6269f5d1 100644
--- a/alot/addressbook/__init__.py
+++ b/alot/addressbook/__init__.py
@@ -15,7 +15,7 @@ class AddressBook(object):
This is an abstract class that leaves :meth:`get_contacts`
unspecified. See :class:`AbookAddressBook` and
- :class:`MatchSdtoutAddressbook` for implementations.
+ :class:`ExternalAddressbook` for implementations.
"""
def __init__(self, ignorecase=True):
self.reflags = re.IGNORECASE if ignorecase else 0
diff --git a/alot/ui.py b/alot/ui.py
index d81bf0ea..8dff2839 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -3,6 +3,7 @@
# For further details see the COPYING file
import urwid
import logging
+import signal
from twisted.internet import reactor, defer
from settings import settings
@@ -68,6 +69,8 @@ class UI(object):
mainframe = urwid.Frame(urwid.SolidFill())
self.root_widget = urwid.AttrMap(mainframe, global_att)
+ signal.signal(signal.SIGUSR1, self.handle_signal)
+
# set up main loop
self.mainloop = urwid.MainLoop(self.root_widget,
handle_mouse=False,
@@ -637,3 +640,16 @@ class UI(object):
d.addCallback(call_apply)
d.addCallback(call_posthook)
return d
+ def handle_signal(self, signum, frame):
+ """
+ handles UNIX signals
+
+ This function currently just handles SIGUSR1. It could be extended to
+ handle more
+
+ :param signum: The signal number (see man 7 signal)
+ :param frame: The execution frame (https://docs.python.org/2/reference/datamodel.html#frame-objects)
+ """
+ self.current_buffer.rebuild()
+ self.update()
+
diff --git a/docs/source/usage/synopsis.rst b/docs/source/usage/synopsis.rst
index a6e776d4..e507ef82 100644
--- a/docs/source/usage/synopsis.rst
+++ b/docs/source/usage/synopsis.rst
@@ -16,6 +16,11 @@ Options
--version Display version string and exit
--help Display help and exit
+UNIX Signals
+ SIGUSR1
+ Refreshes the current buffer. Useful for telling alot to refresh the
+ view from a mail downloader e.g. Offlineimap.
+
Subommands