incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [16/23] git commit: [#6535] ticket:424 Refactoring: use self.parse_datetime everywhere
Date Thu, 19 Sep 2013 15:31:58 GMT
[#6535] ticket:424 Refactoring: use self.parse_datetime everywhere


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/78616389
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/78616389
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/78616389

Branch: refs/heads/master
Commit: 78616389fdf03b6ebac1f895708d3787dbc03a39
Parents: ae6b9e1
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Sep 17 14:59:35 2013 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Sep 19 14:46:51 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/78616389/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 6c7cf73..96e8be6 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -127,8 +127,8 @@ class GitHubTrackerImporter(ToolImporter):
     def process_fields(self, ticket, issue):
         ticket.summary = issue['title']
         ticket.status = issue['state']
-        ticket.created_date = datetime.strptime(issue['created_at'], '%Y-%m-%dT%H:%M:%SZ')
-        ticket.mod_date = datetime.strptime(issue['updated_at'], '%Y-%m-%dT%H:%M:%SZ')
+        ticket.created_date = self.parse_datetime(issue['created_at'])
+        ticket.mod_date = self.parse_datetime(issue['updated_at'])
         if issue['assignee']:
             owner_line = '*Originally owned by:* {}\n'.format(issue['assignee']['login'])
         else:
@@ -158,7 +158,7 @@ class GitHubTrackerImporter(ToolImporter):
             p = ticket.discussion_thread.add_post(
                     text = body,
                     ignore_security = True,
-                    timestamp = datetime.strptime(comment['created_at'], '%Y-%m-%dT%H:%M:%SZ'),
+                    timestamp = self.parse_datetime(comment['created_at']),
                 )
             p.add_multiple_attachments(attachments)
 
@@ -190,7 +190,7 @@ class GitHubTrackerImporter(ToolImporter):
             title = issue['milestone']['title']
             due = None
             if issue['milestone']['due_on']:
-                due = datetime.strptime(issue['milestone']['due_on'], '%Y-%m-%dT%H:%M:%SZ')
+                due = self.parse_datetime(issue['milestone']['due_on'])
             ticket.custom_fields = {
                 '_milestone': title,
             }


Mime
View raw message