incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [18/25] git commit: [#4213] ticket:346 small refactoring for trac export
Date Mon, 08 Jul 2013 19:28:30 GMT
[#4213]  ticket:346 small refactoring  for trac export


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

Branch: refs/heads/cj/4656
Commit: 964c3d1803292f87a1f30391c22b0f744bb7e26f
Parents: 8993951
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Thu Jun 6 15:48:32 2013 +0400
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Sun Jul 7 06:09:58 2013 +0000

----------------------------------------------------------------------
 scripts/trac_export.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/964c3d18/scripts/trac_export.py
----------------------------------------------------------------------
diff --git a/scripts/trac_export.py b/scripts/trac_export.py
index fcff048..4fcb27a 100755
--- a/scripts/trac_export.py
+++ b/scripts/trac_export.py
@@ -19,7 +19,6 @@
 
 
 import sys
-from pprint import pprint
 import csv
 import urlparse
 import urllib2
@@ -77,9 +76,9 @@ class TracExport(object):
         # be get with single-ticket export (create/mod times is
         # and example).
         self.ticket_map = {}
-        self.ticket_queue = []
         self.start_id = start_id
         self.page = (start_id - 1) / self.PAGE_SIZE + 1
+        self.ticket_queue = self.next_ticket_ids()
 
     def remap_fields(self, dict):
         "Remap fields to adhere to standard taxonomy."
@@ -238,8 +237,8 @@ class TracExport(object):
 
     def next(self):
         while True:
-            if not self.ticket_queue:
-                self.ticket_queue = self.next_ticket_ids()
+            if len(self.ticket_queue) == 0:
+                raise StopIteration
             id, extra = self.ticket_queue.pop(0)
             if id >= self.start_id:
                 break


Mime
View raw message