systemd-python: Moved _reader datetime usage to python

This commit is contained in:
Steven Hiscocks
2013-02-22 16:57:44 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 71766afa2d
commit 7a1b9cd5e4
2 changed files with 18 additions and 44 deletions
+10
View File
@@ -123,6 +123,16 @@ class Journal(_Journal):
return set(self._convert_field(key, value)
for value in super(Journal, self).query_unique(key))
def seek_realtime(self, timestamp):
if isinstance(timestamp, datetime.datetime):
timestamp = int(timestamp.strftime("%s%f"))
return super(Journal, self).seek_realtime(timestamp)
def seek_monotonic(self, timestamp, bootid=None):
if isinstance(timestamp, datetime.timedelta):
timestamp = timestamp.totalseconds()
return super(Journal, self).seek_monotonic(timestamp, bootid)
def log_level(self, level):
"""Sets maximum log level by setting matches for PRIORITY."""
if 0 <= level <= 7: