Age | Commit message (Collapse) | Author | |
---|---|---|---|
2013-04-05 | Use initalization instead of explicit zeroing | Zbigniew Jędrzejewski-Szmek | |
Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert. | |||
2013-03-21 | systemd-python: allow retrieval of single fields | Zbigniew Jędrzejewski-Szmek | |
This can give huge efficiency gains, e.g. if only MESSAGE is required and all other fields can be ignored. | |||
2013-03-21 | systemd-python: split out realtime and monotonic into separate functions | Zbigniew Jędrzejewski-Szmek | |
This matches the C API more closely, and also enables the user to get just partial information, should she desire to do so. Functions names in error messages are modified to not include the class name, because Python uses just the function name into functions declared as METH_NOARGS, and error messages were inconsistent. | |||
2013-03-21 | systemd-python: implement _Reader.test_cursor | Zbigniew Jędrzejewski-Szmek | |
Getting the cursor is split out from .get_next() into .get_cursor(). This mirrors the C API more closely, and also makes things a bit faster if the cursor is not needed. | |||
2013-03-21 | systemd-python: cleanup up usec_t handling | Zbigniew Jędrzejewski-Szmek | |
The behaviour wrt. seconds vs. microseconds was inconsistent. Now _Reader always uses native units (us), while Reader always uses seconds and accepts both floats and ints. This way the conversion is always done in the Python layer, and the lower level API allows access to the journal API without the potentially lossy conversion between double and uint64_t. | |||
2013-03-21 | systemd-python: export sd_journal_get_usage | Zbigniew Jędrzejewski-Szmek | |
2013-03-19 | systemd-python: small cleanups | Zbigniew Jędrzejewski-Szmek | |
- separate methods with two empty lines for clarity - avoid malloc(0) by specyfing private data size as -1 - add method name in error messages | |||
2013-03-19 | systemd-python: add journal.get_catalog() | Zbigniew Jędrzejewski-Szmek | |
This one wraps sd_journal_get_catalog_from_message_id. Thanks to Python namespacing, we can stick to a shorter name. | |||
2013-03-19 | systemd-python: add _Reader.get_catalog() | Zbigniew Jędrzejewski-Szmek | |
This one wraps sd_journaal_get_catalog. | |||
2013-03-19 | systemd-python: add _Reader.closed attribute | Zbigniew Jędrzejewski-Szmek | |
This should make the file interface of _Reader complete. | |||
2013-03-18 | systemd-python: allow Reader to be used as a context manager | Zbigniew Jędrzejewski-Szmek | |
2013-03-15 | systemd-python: add systemd.daemon wrapping sd-daemon | Zbigniew Jędrzejewski-Szmek | |
Please see the documentation (e.g. pydoc3 systemd.daemon) for full description. As usual, systemd._daemon wraps the raw interface, while systemd.daemon provides the more pythonic API. sd_listen_fds, sd_booted, sd_is_fifo, sd_is_socket, sd_is_socket_unix, sd_is_socket_inet, sd_is_mq, and SD_LISTEN_FDS_START are currently wrapped. | |||
2013-03-07 | systemd-python: fix segfault on double close | Zbigniew Jędrzejewski-Szmek | |
2013-03-07 | systemd-python: fix typos | Zbigniew Jędrzejewski-Szmek | |
2013-03-07 | systemd-python: refuse path and flags together in __init__ | Zbigniew Jędrzejewski-Szmek | |
It's better to explictly check, instead of just documenting it. The return value from init is changed from 1 to -1 on error. Python seems to ignore 1 every second time. Looks like a bug in Python, but the return value doesn't seem to be documented anywhere, and -1 works as expected... so let's just use that. | |||
2013-03-07 | systemd-python: export sd_j_get_fd, sd_j_reliable_fd, sd_j_close | Zbigniew Jędrzejewski-Szmek | |
sd_journal_get_fd(j) is called j.fileno(), for compatiblity with Python conventions for file-like objects. More importantly, those new .seek_head() and .seek_tail() do not call .get_next(). This is better, if one wants to skip before retrieving an entry. | |||
2013-03-07 | systemd-python: split .seek() into .seek_head() and .seek_tail() | Zbigniew Jędrzejewski-Szmek | |
This way python code follows the original interface more closely. Also, .seek(0, journal.SEEK_END) was just to much to type. | |||
2013-03-05 | systemd-python: fix error check in _Reader.wait() | Zbigniew Jędrzejewski-Szmek | |
2013-03-01 | systemd-python: add missing check for return of PyDict_SetItem in _reader.c | Lukas Nykryn | |
2013-02-28 | python-systemd: rename Journal to Reader | Zbigniew Jędrzejewski-Szmek | |
It seems inevitable that we'll also grow a writing interface, and then it'll be cumbersome to have a "Journal" for reading, and a "Writer" for writing. | |||
2013-02-28 | systemd-python: return both parts of sd_journal_get_monotonic_usec | Zbigniew Jędrzejewski-Szmek | |
In Python 3, a named tuple is used. In Python 2, a simple tuple is used. In either case, the pair is (timestamp, bootid). | |||
2013-02-28 | python-systemd: check all errors and use automatic cleanup | Zbigniew Jędrzejewski-Szmek | |
__REALTIME_TIMESTAMP and __MONOTONIC_TIMESTAMP return ints. It doesn't make sense to convert to string, just to convert back to a number later on. Also try to follow systemd rules for indentation. | |||
2013-02-28 | systemd-python: polish the docstrings | Zbigniew Jędrzejewski-Szmek | |
2013-02-22 | systemd-python: indenation and style tweaks | Zbigniew Jędrzejewski-Szmek | |
2013-02-22 | systemd-python: downgrade _reader.c to C89 | Zbigniew Jędrzejewski-Szmek | |
2013-02-22 | systemd-python: add casts and fix unused variable warnings in _reader | Zbigniew Jędrzejewski-Szmek | |
2013-02-22 | systemd-python: wrap some python differences using macros | Zbigniew Jędrzejewski-Szmek | |
2013-02-22 | systemd-python: introduce error setting helper | Zbigniew Jędrzejewski-Szmek | |
2013-02-22 | systemd-python: fix memory leak in _reader and minor bugs | Steven Hiscocks | |
iternext now checks for error from get_next, and changed a DECREF to XDECREF rather than NULL check | |||
2013-02-22 | systemd-python: update Journal python docstrings | Steven Hiscocks | |
2013-02-22 | systemd-python: tidy up import names in journal | Steven Hiscocks | |
2013-02-22 | systemd-python: remove unneeded ifdef for query_unique | Steven Hiscocks | |
2013-02-22 | systemd-python: _reader now takes unix timestamp in seconds | Steven Hiscocks | |
2013-02-22 | systemd-python: Update _reader docstrings | Steven Hiscocks | |
2013-02-22 | systemd-python: _reader add_match takes single string | Steven Hiscocks | |
python code now takes care of multiple matches | |||
2013-02-22 | systemd-python: correct data_threshold error return value | Steven Hiscocks | |
2013-02-22 | systemd-python: updated _reader header to standard license | Steven Hiscocks | |
2013-02-22 | systemd-python: Moved _reader datetime usage to python | Steven Hiscocks | |
2013-02-22 | systemd-python: Tidy up _reader error handling | Steven Hiscocks | |
2013-02-22 | systemd-python: some python3 and bug fixes | Steven Hiscocks | |
2013-02-22 | systemd-python: implement this_boot/this_machine in Python | Steven Hiscocks | |
2013-02-22 | systemd-python: Journal log_level moved to python | Steven Hiscocks | |
2013-02-22 | systemd-python: move default call dicts from C to python | Steven Hiscocks | |
2013-02-22 | systemd-python: moved PyRun_String to journal.py code | Steven Hiscocks | |
2013-02-22 | systemd-python: add Journal class for reading journal | Steven Hiscocks | |