From face4a2bacd4de4d8b791068015d78ce05b61064 Mon Sep 17 00:00:00 2001 From: Nicholas Piper Date: Tue, 7 Aug 2007 22:48:06 +0000 Subject: Try to deal with typestamps in a sane way in the Python bindings git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1672 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- bindings/python/ipod.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bindings/python/ipod.py') diff --git a/bindings/python/ipod.py b/bindings/python/ipod.py index c287171..20fd510 100644 --- a/bindings/python/ipod.py +++ b/bindings/python/ipod.py @@ -461,7 +461,10 @@ class Track: if item == "userdata": return gpod.sw_get_track_userdata(self._track) elif item in self._proxied_attributes: - return getattr(self._track, item) + if item.startswith("time_"): + return datetime.datetime.fromtimestamp(getattr(self._track, item)) + else: + return getattr(self._track, item) else: raise KeyError('No such key: %s' % item) -- cgit