Commit graph

223 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
085db21e5e tests: add more tests for socket functions 2015-09-06 18:54:55 +02:00
Zbigniew Jędrzejewski-Szmek
e6b305b41a tests: adapt to python2.7 output again 2015-09-05 14:23:20 +02:00
Zbigniew Jędrzejewski-Szmek
0cf0cf7e42 tests: daemon.booted 2015-09-05 14:18:32 +02:00
Zbigniew Jędrzejewski-Szmek
2e115f3c4f tests: daemon.listen_fds 2015-09-05 14:18:23 +02:00
Zbigniew Jędrzejewski-Szmek
c76c5f0ef7 tests: fix test discovery by pytest 2015-09-05 13:47:47 +02:00
Zbigniew Jędrzejewski-Szmek
26a9c1f18a tests: also collect doctests from rst
There isn't much to test now, but it doesn't hurt to enable.
2015-09-05 13:33:40 +02:00
Zbigniew Jędrzejewski-Szmek
cc5f218a50 tests: enable doctests in the sources
Unfortunately the "standard" way to access the names in the
defined module does not work. I find it nicer to explicitly import,
e.g. from systemd import journal, because then the examples
correspond more closely to what a user would use. The only
exception is made for JournalHandler, because journal.JournalHandler
is a tad to long.
2015-09-05 13:09:43 +02:00
Evgeny Vereshchagin
b71b8b64eb Fix booted() doc 2015-09-04 18:30:10 +02:00
Zbigniew Jędrzejewski-Szmek
f83dea9f8d Add compatibility with systemd < 205 2015-09-04 17:16:28 +02:00
Zbigniew Jędrzejewski-Szmek
c71fbb58e5 build-sys: output full pkg-config output on failure 2015-09-04 12:21:28 +02:00
Zbigniew Jędrzejewski-Szmek
ddca9bbe3a build-sys: use pkg-config to build with old systemd
This should allow the build to just work on old Ubuntu
and similar.
2015-09-04 09:50:51 +02:00
Zbigniew Jędrzejewski-Szmek
d03d276625 README: add semaphore build badge 2015-09-03 20:27:36 +02:00
Zbigniew Jędrzejewski-Szmek
a93828172f tests: add first test
This is based on the code in https://github.com/systemd/python-systemd/pull/4
by Jacek Konieczny <j.konieczny@eggsoft.pl>.
2015-08-07 11:49:56 -04:00
Zbigniew Jędrzejewski-Szmek
d2bc513440 tree-wide: systemd→python-systemd in headers 2015-08-07 11:49:56 -04:00
Zbigniew Jędrzejewski-Szmek
40e08de1a6 build-sys: add clean targets 2015-08-07 11:49:56 -04:00
Jacek Konieczny
71d82616a8 Fix daemon.is_fifo and .is_mq under Python 3
The 'path' parameter was not properly converted from Unicode
and the functions would always fail when a path was provided.

https://github.com/systemd/python-systemd/pull/4
2015-08-07 11:49:42 -04:00
David Strauss
58c65cf10a Update source building instructions
* Only list Fedora 21+. Older releases are no longer supported by upstream, let alone for systemd development.
* Fedora now uses `pip` and `pip3`, not `pip-python` and `pip-python3`. By only documenting Fedora 21+, we can be consistent in the instructions.
* Use HTTPS for git (rather than HTTP).
2015-08-02 10:18:01 -04:00
Zbigniew Jędrzejewski-Szmek
108d3d8ea9 build-sys: also add installation and dist targets 2015-07-08 15:32:40 -04:00
Zbigniew Jędrzejewski-Szmek
344d520d8c build-sys: exclude id128-constants.h after all
This file should be rebuild from latest systemd headers, and
not distributed here.
2015-07-08 15:23:02 -04:00
Zbigniew Jędrzejewski-Szmek
c030a453c2 docs: avoid warning about duplicate target name 2015-07-08 15:17:00 -04:00
Zbigniew Jędrzejewski-Szmek
2f5a390239 docs: update links in documentation
This is a standalone package now, but let's keep the links
to systemd itself.
2015-07-08 15:12:25 -04:00
Zbigniew Jędrzejewski-Szmek
f13a571db2 build-sys: call setup.py from make 2015-07-08 14:49:46 -04:00
Zbigniew Jędrzejewski-Szmek
e706969039 build-sys: add make rules for documentation 2015-07-08 14:47:46 -04:00
Zbigniew Jędrzejewski-Szmek
1ad7f56b90 Move docs to top level and include in manifest 2015-07-08 13:45:03 -04:00
Zbigniew Jędrzejewski-Szmek
2cef4ef7fc Bump version to 230 v230
This matches what was done for libgudev. This way we have plenty of time
to remove the module from systemd, and this version will always be "newer".
2015-07-05 21:37:09 -04:00
Zbigniew Jędrzejewski-Szmek
f58519d53e Specify system-devel@ as the maintainers 2015-07-05 21:32:42 -04:00
Zbigniew Jędrzejewski-Szmek
9d0b8bbaf0 build-sys: add MANIFEST.in to properly include all files 2015-07-05 21:32:42 -04:00
Zbigniew Jędrzejewski-Szmek
e1ce6a2802 Use python-systemd as the name
We want the package to be installed under this name.
This is also used for sdist, and we want python-systemd-<version>.tar.xz.
2015-07-05 21:32:42 -04:00
Zbigniew Jędrzejewski-Szmek
410f054ddf Update LICENSE file and classifiers
The license was originally MIT, but when this module became part of systemd,
it was changed to LGPLv2+. All files had correct headers, so only the LICENSE
file needs updating. Take the opportunity to add classifiers to setup.py.
2015-07-05 20:16:51 -04:00
Zbigniew Jędrzejewski-Szmek
31baccc855 build-sys: update setup.py to build everything 2015-07-05 15:10:30 -04:00
Zbigniew Jędrzejewski-Szmek
022c9b5be4 Merge development in systemd upstream 2015-07-05 14:19:22 -04:00
Kay Sievers
2a3fc158a5 remove gudev and gtk-doc
The library moved to:
  https://git.gnome.org/browse/libgudev/
2015-07-05 14:19:22 -04:00
Simon Farnsworth
d6c4257815 python-systemd: fix is_socket_inet to cope with ports
Just a couple of trivial oversights.
2015-07-05 14:19:22 -04:00
Dave Reisner
7ea37c0d40 python-systemd: avoid hitting assert in __exit__
Reader_close() asserts that 'args' is always NULL, but the __exit__
function forwards a non-NULL args.
2015-07-05 14:19:22 -04:00
Zbigniew Jędrzejewski-Szmek
a68a57ed71 Always prefer our headers to system headers
In practice this shouldn't make much difference, but
sometimes our headers might be newer, and we want to
test them.
2015-07-05 14:19:22 -04:00
Zbigniew Jędrzejewski-Szmek
4398250261 systemd-python: fix failing assert
A parameter which was always null before, now get's set to
the module.
2015-07-05 14:19:21 -04:00
Zbigniew Jędrzejewski-Szmek
583f1a9441 systemd-python: use .hex instead of .get_hex()
It turns out the latter got removed in Python 3.

https://bugs.freedesktop.org/show_bug.cgi?id=77086
2015-07-05 14:19:21 -04:00
Lennart Poettering
f7cf47eb64 python: reindent _reader.c
All files should follow our coding style, and that means 8ch indenting.
Let's correct that.
2015-07-05 14:19:21 -04:00
Lennart Poettering
ce4e46ae66 macro: introduce nice macro for disabling -Wmissing-prototypes warnigs 2015-07-05 14:19:21 -04:00
Lennart Poettering
5e1d42a180 util: use alloca0() intead of alloca() + memzero() 2015-07-05 14:19:21 -04:00
Greg KH
5cf9be60ca use memzero(foo, length); for all memset(foo, 0, length); calls
In trying to track down a stupid linker bug, I noticed a bunch of
memset() calls that should be using memzero() to make it more "obvious"
that the options are correct (i.e. 0 is not the length, but the data to
set).  So fix up all current calls to memset(foo, 0, length) to
memzero(foo, length).
2015-07-05 14:19:21 -04:00
Zbigniew Jędrzejewski-Szmek
d109c7035f systemd-python: fix listen_fds under Python 2 2015-07-05 14:19:21 -04:00
Zbigniew Jędrzejewski-Szmek
73f327ce21 systemd-python: fix setting of exception codes
The return value of 0 would be treated as failure by mistake,
resulting in " SystemError: error return without exception set".
The way that set_error() is used is changed to be the same
everywhere.
2015-07-05 14:19:21 -04:00
Thomas Hindoe Paaboel Andersen
2ebe9bf6c3 trivial coding style clean ups
- Add space between if/for and the opening parentheses
- Place the opening brace on same line as the function (not for  udev)

From the CODING_STYLE
Try to use this:
    void foo() {
    }
instead of this:
    void foo()
    {
    }
2015-07-05 14:19:21 -04:00
Zbigniew Jędrzejewski-Szmek
07c1d9a144 systemd-python: fix booted() and add two functions to docs
For some reason sphinx doesn't want to show inherited C functions.
2015-07-05 14:19:21 -04:00
Richard Marko
7bb40a26e0 systemd-python: convert keyword value to string
Allows using journal.send('msg', PRIORITY=journal.LOG_CRIT)

Before this commit this results in
TypeError: cannot concatenate 'str' and 'int' objects
and requires passing PRIORITY value as string to work.
2015-07-05 14:19:21 -04:00
Zbigniew Jędrzejewski-Szmek
39970127f2 systemd-python: check for oom, give nicer error messages 2015-07-05 14:19:21 -04:00
Steven Hiscocks
ec9078e45e systemd-python: fix initialization of _Reader objects
https://bugzilla.redhat.com/show_bug.cgi?id=995575
2015-07-05 14:19:21 -04:00
Zbigniew Jędrzejewski-Szmek
ac8b2b3eb3 systemd-python: fix gcc warning
src/python-systemd/_reader.c: In function Reader_get_catalog:
src/python-systemd/_reader.c:912:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             assert(mid_len > l);
                            ^
2015-07-05 14:19:21 -04:00
Zbigniew Jędrzejewski-Szmek
7583998db7 systemd-python: use modern C 2015-07-05 14:19:20 -04:00