X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fpython-systemd%2F_reader.c;h=95e60941622356ac2d5f3a35cd04e19b46550070;hb=518dc5dff557116db3f072eb9d0a9492b6226778;hp=8f21678c81cc4c3fa19b8b22fff5ba966a35079a;hpb=5bb2b8d5e40eadde6ab9cc2941d2395c93e2a545;p=elogind.git diff --git a/src/python-systemd/_reader.c b/src/python-systemd/_reader.c index 8f21678c8..95e609416 100644 --- a/src/python-systemd/_reader.c +++ b/src/python-systemd/_reader.c @@ -217,12 +217,11 @@ Journal_get_previous(Journal *self, PyObject *args) } PyDoc_STRVAR(Journal_add_match__doc__, -"add_match(match, ..., field=value, ...) -> None\n\n" +"add_match(match) -> None\n\n" "Add a match to filter journal log entries. All matches of different\n" -"field are combined in logical AND, and matches of the same field\n" +"fields are combined in logical AND, and matches of the same field\n" "are automatically combined in logical OR.\n" -"Matches can be passed as strings \"field=value\", or keyword\n" -"arguments field=\"value\"."); +"Match is string of form \"field=value\"."); static PyObject * Journal_add_match(Journal *self, PyObject *args, PyObject *keywds) { @@ -337,15 +336,17 @@ Journal_seek(Journal *self, PyObject *args, PyObject *keywds) PyDoc_STRVAR(Journal_seek_realtime__doc__, "seek_realtime(realtime) -> None\n\n" "Seek to nearest matching journal entry to `realtime`. Argument\n" -"`realtime` can be an integer unix timestamp in usecs or a " -"datetime instance."); +"`realtime` can must be an integer unix timestamp."); static PyObject * Journal_seek_realtime(Journal *self, PyObject *args) { - uint64_t timestamp; - if (! PyArg_ParseTuple(args, "K", ×tamp)) + double timedouble; + if (! PyArg_ParseTuple(args, "d", &timedouble)) return NULL; + uint64_t timestamp; + timestamp = (uint64_t) (timedouble * 1.0E6); + if ((int64_t) timestamp < 0LL) { PyErr_SetString(PyExc_ValueError, "Time must be positive integer"); return NULL; @@ -366,8 +367,7 @@ Journal_seek_realtime(Journal *self, PyObject *args) PyDoc_STRVAR(Journal_seek_monotonic__doc__, "seek_monotonic(monotonic[, bootid]) -> None\n\n" "Seek to nearest matching journal entry to `monotonic`. Argument\n" -"`monotonic` is an timestamp from boot in secs, or a\n" -"timedelta instance.\n" +"`monotonic` is an timestamp from boot in seconds.\n" "Argument `bootid` is a string representing which boot the\n" "monotonic time is reference to. Defaults to current bootid."); static PyObject *