chiark / gitweb /
update NEWS
[elogind.git] / src / python-systemd / docs / journal.rst
index 78b831afff05b11aecce5168ca49573a1562d51f..ea74cf85c408f499255e95a091db684e1173930b 100644 (file)
@@ -23,23 +23,38 @@ Accessing the Journal
 
    .. automethod:: __init__
 
+.. autofunction:: _get_catalog
+.. autofunction:: get_catalog
+
 .. autoclass:: Monotonic
 
 .. autoattribute:: systemd.journal.DEFAULT_CONVERTERS
 
-Whence constants
-~~~~~~~~~~~~~~~~
+Example: polling for journal events
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This example shows that journal events can be waited for (using
+e.g. `poll`). This makes it easy to integrate Reader in an external
+event loop:
+
+  >>> import select
+  >>> from systemd import journal
+  >>> j = journal.Reader()
+  >>> j.seek_tail()
+  >>> p = select.poll()
+  >>> p.register(j, j.get_events())
+  >>> p.poll()
+  [(3, 1)]
+  >>> j.get_next()
 
-.. autoattribute:: systemd.journal.SEEK_SET
-.. autoattribute:: systemd.journal.SEEK_CUR
-.. autoattribute:: systemd.journal.SEEK_END
 
 Journal access types
 ~~~~~~~~~~~~~~~~~~~~
 
 .. autoattribute:: systemd.journal.LOCAL_ONLY
 .. autoattribute:: systemd.journal.RUNTIME_ONLY
-.. autoattribute:: systemd.journal.SYSTEM_ONLY
+.. autoattribute:: systemd.journal.SYSTEM
+.. autoattribute:: systemd.journal.CURRENT_USER
 
 Journal event types
 ~~~~~~~~~~~~~~~~~~~