Package: python-debianbts
Version: 0.3
Severity: normal
Tags: patch

Bugreport.firstaction and Bugreport.lastaction are currently strings.
I believe it would be much more useful if they were datetime objects.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (900, 'unstable'), (500, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.29-2-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-debianbts depends on:
ii  python-soappy                 0.12.0-4   SOAP Support for Python
ii  python-support                1.0.3      automated rebuilding support for P

python-debianbts recommends no packages.

python-debianbts suggests no packages.

-- no debconf information

--
Jakub Wilk
diff --git a/src/debianbts.py b/src/debianbts.py
--- a/src/debianbts.py
+++ b/src/debianbts.py
@@ -23,6 +23,7 @@
 import time
 from HTMLParser import HTMLParser
 import urllib
+from datetime import datetime
 
 # Setup the soap server
 # TODO: recognize HTTP proxy environment variable    # Default values
@@ -151,8 +152,8 @@
     tmp = status['value']
     bug.summary = unicode(tmp['subject'], 'utf-8')
     bug.package =  unicode(tmp['package'], 'utf-8')
-    bug.firstaction = time.strftime('%Y-%m-%d',time.gmtime(tmp['date']))
-    bug.lastaction = time.strftime('%Y-%m-%d',time.gmtime(tmp['log_modified']))
+    bug.firstaction = datetime.utcfromtimestamp(tmp['date'])
+    bug.lastaction = datetime.utcfromtimestamp(tmp['log_modified'])
     bug.severity = unicode(tmp['severity'], 'utf-8')
     if tmp['done']:
         bug.status = u"Resolved"

Reply via email to