summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-07-28 15:53:00 +0200
committerLuboš Luňák <l.lunak@suse.cz>2013-07-29 09:42:04 +0000
commitdf3b3f7e31a78aa8fb9228fc44a299fc4b88de9d (patch)
treeae0b94cfa07b147d7901d07cf74d2266a8847399
parentb7d74f9e95c7977ff2b527267661d7760c945c02 (diff)
Adapt gdb python pretty-printer to time nano-second precision API change
Change-Id: I416d98a298f00ae445a480c738a47758544d317c Reviewed-on: https://gerrit.libreoffice.org/5150 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
-rw-r--r--solenv/gdb/libreoffice/tl.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py
index 71ff822cde5b..7c18a9555434 100644
--- a/solenv/gdb/libreoffice/tl.py
+++ b/solenv/gdb/libreoffice/tl.py
@@ -149,27 +149,27 @@ class DatePrinter(object):
class TimeImpl(DateTimeImpl):
- def __init__(self, hour, minute, second, hundreth_of_second = 0):
+ def __init__(self, hour, minute, second, nanosecond = 0):
super(TimeImpl, self).__init__(None, self)
self.hour = hour
self.minute = minute
self.second = second
- self.hundreth_of_second = hundreth_of_second
+ self.nanosecond = nanosecond
def __str__(self):
decimal = ''
- if self.hundreth_of_second != 0:
- decimal = '.%d' % self.hundreth_of_second
- return "%d:%d:%d%s" % (self.hour, self.minute, self.second, decimal)
+ if self.nanosecond != 0:
+ decimal = '.%09d' % self.nanosecond
+ return "%02d:%02d:%02d%s" % (self.hour, self.minute, self.second, decimal)
@staticmethod
def parse(val):
time = val['nTime']
- h = time / 1000000
- m = (time / 10000) % 100
- s = (time / 100) % 100
- s_100 = time % 100
- return TimeImpl(h, m, s, s_100)
+ h = time / 10000000000000
+ m = (time / 100000000000) % 100
+ s = (time / 1000000000) % 100
+ ns = time % 1000000000
+ return TimeImpl(h, m, s, ns)
class TimePrinter(object):
'''Prints time'''