aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-10-31 20:46:47 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-10-31 23:25:35 +0800
commit63c723259e40da25c7ab3a8be1b05a2083fa9915 (patch)
treee550739aea25f755fb2d732cea1e285e056fadfa
parent381eb5147aad3488f000201487ec744252698977 (diff)
downloadgsoc2013-empathy-63c723259e40da25c7ab3a8be1b05a2083fa9915.tar
gsoc2013-empathy-63c723259e40da25c7ab3a8be1b05a2083fa9915.tar.gz
gsoc2013-empathy-63c723259e40da25c7ab3a8be1b05a2083fa9915.tar.bz2
gsoc2013-empathy-63c723259e40da25c7ab3a8be1b05a2083fa9915.tar.lz
gsoc2013-empathy-63c723259e40da25c7ab3a8be1b05a2083fa9915.tar.xz
gsoc2013-empathy-63c723259e40da25c7ab3a8be1b05a2083fa9915.tar.zst
gsoc2013-empathy-63c723259e40da25c7ab3a8be1b05a2083fa9915.zip
release.py: use dateutil's parser
Makes code much easier and fix a crash if the commit date includes a negative timezone offset (like 'Mon Oct 14 13:13:03 2013 -0400').
-rwxr-xr-xrelease.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/release.py b/release.py
index 5b1324064..59919e8f9 100755
--- a/release.py
+++ b/release.py
@@ -1,13 +1,12 @@
#!/usr/bin/env python
import os
-import re
import urllib
import csv
import datetime
-import time
from string import Template
from optparse import OptionParser
+import dateutil.parser
last_tag_pattern = 'EMPATHY_3_10*'
upload_server = 'master.gnome.org'
@@ -172,9 +171,9 @@ class Project:
commit_str = self.exec_cmd('git show %s' % (self.last_tag))
for line in commit_str.splitlines():
if line.startswith('Date:'):
- time_str = line[5:line.rfind('+')].strip()
- t = time.strptime(time_str)
- last_tag_date = time.strftime('%Y-%m-%d', t)
+ time_str = line[5:]
+ t = dateutil.parser.parse(time_str)
+ last_tag_date = t.strftime('%Y-%m-%d')
break
query = 'http://bugzilla.gnome.org/buglist.cgi?' \