Re: [systemd-devel] [PATCH] python-systemd: Reader return special fields and _Reader changes

2013-05-16 Thread Steven Hiscocks
ay we also preserve symmetry, because seek_cursor accepts a string. I'm pushing a patch adding an entry to converters. Zbyszek Thanks Zbyszek. Also, thanks for adding the version numbers :) -- Steven Hiscocks ___ systemd-devel mailing list sys

Re: [systemd-devel] [PATCH] python-systemd: Reader return special fields and _Reader changes

2013-05-12 Thread Steven Hiscocks
On 14/04/13 20:55, Steven Hiscocks wrote: def get_next(self, skip=1): -"""Return the next log entry as a dictionary of fields. +"""Return the next log entry as a mapping type, currently +a standard dictionary of fields. Optio

Re: [systemd-devel] [PATCH] python-systemd: add version number

2013-04-30 Thread Steven Hiscocks
On 30/04/13 03:33, Zbigniew Jędrzejewski-Szmek wrote: On Tue, Apr 23, 2013 at 08:11:03PM +0100, Steven Hiscocks wrote: From: Steven Hiscocks --- Hi, I thought it would be useful to have a version number in the python systemd module. Hi, I haven't replied to this before because o

Re: [systemd-devel] [PATCH v2] systemd-python: attach fields to JournalHandler, add SYSLOG_IDENTIFIER

2013-04-24 Thread Steven Hiscocks
MESSAGE_ID=mid, PRIORITY=format(pri), @@ -516,7 +529,7 @@ class JournalHandler(_logging.Handler): CODE_FILE=record.pathname, CODE_LINE=record.lineno, CODE_FUNC=record.funcName, -

[systemd-devel] [PATCH] python-systemd: add version number

2013-04-23 Thread Steven Hiscocks
From: Steven Hiscocks --- Hi, I thought it would be useful to have a version number in the python systemd module. I'm not overly familiar with Make, etc. but hopefully I've taken the right approach. :) Thanks Steven Hiscocks Makefile.am|

Re: [systemd-devel] [RFC PATCH] systemd-python: add SYSLOG_IDENTIFIER to JournalHandler

2013-04-22 Thread Steven Hiscocks
On 22/04/13 22:15, Zbigniew Jędrzejewski-Szmek wrote: On Mon, Apr 22, 2013 at 09:53:55PM +0100, Steven Hiscocks wrote: +self._SYSLOG_IDENTIFIER = (_sys.argv[0] + if SYSLOG_IDENTIFIER is None

Re: [systemd-devel] [RFC PATCH] systemd-python: add SYSLOG_IDENTIFIER to JournalHandler

2013-04-22 Thread Steven Hiscocks
THREAD_NAME=record.threadName, How about having the value as `__name__`, but`_sys.argv[0]` if `__name__ == "__main__`? -- Steven Hiscocks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] Python journal reader

2013-04-15 Thread Steven Hiscocks
and `get_previous` does on the traversal and getting of both special and standard fields to simplify use of the Reader. On Sun, Apr 14, 2013 at 10:49 AM, Zbigniew Jędrzejewski-Szmek wrote: On Sun, Apr 14, 2013 at 03:28:31PM +0100, Steven Hiscocks wrote: On 14/04/13 03:36, David Strauss wrote: I

Re: [systemd-devel] [PATCH] systemd-python: export new sd_journal_{process, get_events, get_timeout}

2013-04-15 Thread Steven Hiscocks
Otherwise looks good to me :) -- Steven Hiscocks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

[systemd-devel] [PATCH] python-systemd: Reader return special fields and _Reader changes

2013-04-14 Thread Steven Hiscocks
From: Steven Hiscocks Changes to _Reader make it match closer to C API, by removing `get_next` and `get_previous`. A `get_all` method added, which returns dictionary of fields using C API SD_JOURNAL_FOREACH_DATA macro, which can be used in conjunction with `next`. _Reader `get`, `next`, `get_

Re: [systemd-devel] Python journal reader

2013-04-14 Thread Steven Hiscocks
lazy convert the fields on access. This is starting to get complicated thought...) Hopefully I've covered everything. Feedback welcomed :-) -- Steven Hiscocks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] Python journal reader

2013-04-13 Thread Steven Hiscocks
On 13/04/13 23:47, Steven Hiscocks wrote: On 13/04/13 23:00, David Strauss wrote: If seems like we should put the conditional special handling for __REALTIME_TIMESTAMP and __MONOTONIC_TIMESTAMP in either _reader.c or right in get(). Here's why: * With the code above, calling Reade

Re: [systemd-devel] Python journal reader

2013-04-13 Thread Steven Hiscocks
'__REALTIME_TIMESTAMP'] = self.get_realtime() +entry['__MONOTONIC_TIMESTAMP'] = self.get_monotonic() +entry['__CURSOR'] = self.get_cursor() + +return entry def query_unique(self, field): """Return unique values

Re: [systemd-devel] Journal issues

2013-04-12 Thread Steven Hiscocks
On 13/04/13 00:00, Mirco Tischler wrote: 2013/4/12 Steven Hiscocks mailto:steven-syst...@hiscocks.me.uk>> Hi, I'm having two issues in relation to the journal with my recent upgrade to v201. One issue, is that it appears that "_MACHINE_ID" fie

[systemd-devel] Journal issues

2013-04-12 Thread Steven Hiscocks
introduced. Both issues can be easily seen with journalctl output in "export" format. I've seen this issue on two of Arch Linux x86_64 systems. Thanks :) -- Steven Hiscocks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

[systemd-devel] Python journal reader

2013-04-12 Thread Steven Hiscocks
try( super(Reader, self).get_next(skip)) +entry['__REALTIME_TIMESTAMP'] = self.get_realtime() +entry['__MONOTONIC_TIMESTAMP'] = self.get_monotonic() +entry['__CURSOR'] = self.get_cursor() + +return entry def query_unique(sel

[systemd-devel] python-systemd wait bug

2013-04-06 Thread Steven Hiscocks
t(us) def seek_realtime(self, realtime): """Seek to a matching journal entry nearest to `realtime` time. Thanks :) -- Steven Hiscocks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] [systemd-commits] 42 commits - configure.ac Makefile.am man/.gitignore README src/journal src/python-systemd

2013-03-01 Thread Steven Hiscocks
nup can be done in the main tree. Thank you for the module! Zbyszek Brilliant. Thank you for your patience, input and contributions. As you may have noticed I'm a bit of a novice when it comes to C and the python C-API,so you assistance was greatly appreciated. --

Re: [systemd-devel] python - reading the journal

2013-02-23 Thread Steven Hiscocks
On 23/02/13 00:43, Zbigniew Jędrzejewski-Szmek wrote: On Thu, Feb 21, 2013 at 06:46:35PM +, Steven Hiscocks wrote: On 21/02/13 01:49, Zbigniew Jędrzejewski-Szmek wrote: On Tue, Feb 19, 2013 at 09:02:56PM +, Steven Hiscocks wrote: I've pushed a few more commits. I've pu

Re: [systemd-devel] python - reading the journal

2013-02-21 Thread Steven Hiscocks
On 21/02/13 01:49, Zbigniew Jędrzejewski-Szmek wrote: On Tue, Feb 19, 2013 at 09:02:56PM +, Steven Hiscocks wrote: I've pushed a few more commits. I've pushed a few commits to https://github.com/keszybz/systemd/commits/python-systemd-reader This is your tree but rebased onto my i

Re: [systemd-devel] python - reading the journal

2013-02-19 Thread Steven Hiscocks
On 19/02/13 07:05, David Strauss wrote: On Mon, Feb 18, 2013 at 11:28 AM, Steven Hiscocks wrote: Sounds good. I suppose `log_level` should become `add_loglevel_matches` for consistency. (or actually `add_priority_matches`?) "Log level" is the Pythonic language; please continue usi

Re: [systemd-devel] python - reading the journal

2013-02-18 Thread Steven Hiscocks
the converters failed. -- David Strauss | da...@davidstrauss.net | +1 512 577 5827 [mobile] On Fri, Feb 15, 2013 at 9:28 AM, Steven Hiscocks wrote: On 11/02/13 05:49, Zbigniew Jędrzejewski-Szmek wrote: On Fri, Feb 08, 2013 at 10:20:57PM +, Steven Hiscocks wrote: I thought th

Re: [systemd-devel] python - reading the journal

2013-02-15 Thread Steven Hiscocks
On 11/02/13 05:49, Zbigniew Jędrzejewski-Szmek wrote: On Fri, Feb 08, 2013 at 10:20:57PM +, Steven Hiscocks wrote: I thought the easiest way was to just inherit the Journal (now _Journal), replacing __new__ with all the python RunString stuff. https://github.com/kwirk/systemd/commit

Re: [systemd-devel] python - reading the journal

2013-02-08 Thread Steven Hiscocks
On 08/02/13 20:51, Zbigniew Jędrzejewski-Szmek wrote: On Fri, Feb 08, 2013 at 07:51:48PM +, Steven Hiscocks wrote: On 06/02/13 00:55, Zbigniew Jędrzejewski-Szmek wrote: On Tue, Feb 05, 2013 at 11:45:10PM +, Steven Hiscocks wrote: On 05/02/13 23:00, Zbigniew Jędrzejewski-Szmek wrote

Re: [systemd-devel] python - reading the journal

2013-02-08 Thread Steven Hiscocks
On 06/02/13 00:55, Zbigniew Jędrzejewski-Szmek wrote: On Tue, Feb 05, 2013 at 11:45:10PM +, Steven Hiscocks wrote: On 05/02/13 23:00, Zbigniew Jędrzejewski-Szmek wrote: On Tue, Feb 05, 2013 at 09:22:46PM +, Steven Hiscocks wrote: On 05/02/13 02:49, Zbigniew Jędrzejewski-Szmek wrote

Re: [systemd-devel] python - reading the journal

2013-02-06 Thread Steven Hiscocks
On 06/02/13 00:55, Zbigniew Jędrzejewski-Szmek wrote: On Tue, Feb 05, 2013 at 11:45:10PM +, Steven Hiscocks wrote: On 05/02/13 23:00, Zbigniew Jędrzejewski-Szmek wrote: On Tue, Feb 05, 2013 at 09:22:46PM +, Steven Hiscocks wrote: On 05/02/13 02:49, Zbigniew Jędrzejewski-Szmek wrote

Re: [systemd-devel] python - reading the journal

2013-02-05 Thread Steven Hiscocks
On 05/02/13 23:00, Zbigniew Jędrzejewski-Szmek wrote: On Tue, Feb 05, 2013 at 09:22:46PM +, Steven Hiscocks wrote: On 05/02/13 02:49, Zbigniew Jędrzejewski-Szmek wrote: Hi, On Mon, Feb 04, 2013 at 10:42:02PM +, Steven Hiscocks wrote: I've made the suggested changes and pushed

Re: [systemd-devel] python - reading the journal

2013-02-05 Thread Steven Hiscocks
On 05/02/13 02:49, Zbigniew Jędrzejewski-Szmek wrote: Hi, On Mon, Feb 04, 2013 at 10:42:02PM +, Steven Hiscocks wrote: I've made the suggested changes and pushed it to github. Feedback welcomed :) Thanks! Some more thoughts on the API below. Some of those are probably stupid, but I

Re: [systemd-devel] python - reading the journal

2013-02-04 Thread Steven Hiscocks
On 04/02/13 18:30, Steven Hiscocks wrote: On 04/02/13 05:13, David Strauss wrote: I second the interest in committing this to the existing Python support once polished. On Sun, Feb 3, 2013 at 6:07 PM, Zbigniew Jędrzejewski-Szmek wrote: On Sun, Feb 03, 2013 at 09:18:28PM +, Steven

Re: [systemd-devel] python - reading the journal

2013-02-04 Thread Steven Hiscocks
On 04/02/13 05:13, David Strauss wrote: I second the interest in committing this to the existing Python support once polished. On Sun, Feb 3, 2013 at 6:07 PM, Zbigniew Jędrzejewski-Szmek wrote: On Sun, Feb 03, 2013 at 09:18:28PM +, Steven Hiscocks wrote: Hi, I've been develop

[systemd-devel] python - reading the journal

2013-02-03 Thread Steven Hiscocks
is is this the intended behaviour, or is this a bug? Thanks :) -- Steven Hiscocks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel